Showing Code file and navigating pages.
|
Difference among asp. net 1.1 and 3.5 (asp. net 2.0, 3.0, and 3.5 )
In order to show the differences, we need to create a site and scale
down to asp.1.1
|
Copy this folder Website-3511 folder, paste as separate folder, rename
it as WebSite-12 and open it with VWD;

|
Add a New file


Then update the codes.
default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="default.aspx.cs"
Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>default.aspx VWD website-3511</title>
</head>
<body>
<form id="form1" runat="server" >
<div style="background-color: #FFFFCC; border: medium double #800080;
width: 367px; height: 61px; margin-left: 13px; margin-top: 28px;">
This is a div-html-element, will run in an html page.<a href="AspNet11.aspx">Using
ASPNet11 style</a>
</div>
</form>
</body>
</html>
|
Modify web.config
<?xml version="1.0"?>
<configuration>
<system.web>
<authentication mode="Forms">
<forms loginUrl="default.aspx" protection="All" timeout="60"/>
</authentication>
<authorization>
<allow users="*"/>
</authorization>
<compilation debug="true"/></system.web>
</configuration>

Code AspNet11.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AspNet11.aspx.cs"
Inherits="AspNet11" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ASPNet 3.5 Uses CodeFile AspNet11.aspx.cs</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<% Dosomething ds = new Dosomething();
Response.Write(ds.method1()); %>
</div>
</form>
</body>
</html>
Code AspNet11.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
//using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
//using System.Xml.Linq;
public partial class AspNet11 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
public class Dosomething : System.Web.UI.Page
{
public string method1()
{
return("Hi There");
}
}
|
Before, build the project, let us create a virtual directory for this
web site, to run these pages.


Point it to the correct folder


Since it is a demo, have full write to youself.

Virtual directory is created

|
Run time show

If you Navigate to ASPNet11, the message will be displayed from the
code from the supporting page ASPNet11.aspx.cs

|
Now let us with old asp.net 1.1 style, create a folder and copy these
file from WEbSite-3512, and placed within this folder


Now publish it as a web holder using IIS console



|
Now edit this page

Code ASPNet11.aspx
<%@ Page Language="C#" Src="AspNet11.aspx.cs" Inherits="AspNet11" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ASPNet 3.5 Uses SRCAspNet11.aspx.cs</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<% Dosomething ds = new Dosomething();
Response.Write(ds.method1()); %>
</div>
</form>
</body>
</html>

Code
using System;
using System.Collections;
using System.Configuration;
using System.Data;
//using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
//using System.Xml.Linq;
public partial class AspNet11 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
public class Dosomething : System.Web.UI.Page
{
public string method1()
{
return("Hi There I am changed");
}
}
|
Now run

Note the title "ASPNet 3.5 Uses Src AspNet11.aspx.cs" and the contents
of this page.

|
| |
| |
| |
| |
| |