ASP.NET - Migration from ASP to ASP.net - Asked By Shiv Kant Pandey on 19-May-11 03:17 AM

How to convert ASP site to ASP.NET site using C#
dipa ahuja replied to Shiv Kant Pandey on 19-May-11 03:25 AM
http://www.asp.net/downloads/archived-v11/migration-assistants/asp-to-aspnet
Reena Jain replied to Shiv Kant Pandey on 19-May-11 03:29 AM
hi,

ASP.NET framework is very much different from unstrucured ASP and there is no correct way to just transform it into ASP.NET pages, and if you really want to convert your application and make it ASP.NET based then you have to remodel it and code again almost all the pages , the most prominnet reason why you will do this are

  •  ASP supported scripting languages such as VB Script or Javscript while ASP.NEt supports proper Object oriented languages such as C# or VB.NET etc
  •   In ASP.NET you do proper Event based programming which was impossible in ASP
  •   ASP.NET seperates the code part from HTML parts , which in case of ASP all mixed up
  •   ASP.NET introduced server controls which aree much powerful then ASP controls
hope this will help you
Ravi S replied to Shiv Kant Pandey on 19-May-11 03:30 AM
HI

try this code
<%@ Page Language="c#" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<script runat="server"> 


protected void Page_Load(object sender, System.EventArgs e)
{
	// Set values and format links 
	FormatLinks(HyperLink1, "1.aspx", "One");
	FormatLinks(HyperLink2, "2.aspx", "Two");
	FormatLinks(HyperLink3, "3.aspx", "Three");
}

protected void FormatLinks(HyperLink myLink, string strPage, string strLinkText)
{
// Declare constants
string strRootLink = "http://somewhere/";
string cssClass1 = "current";
string cssClass2 = "nav";

// Get current file name
string strUrl = Request.ServerVariables("script_name");

// Set Link text and URL
myLink.Text = strLinkText;
myLink.NavigateUrl = string.Concat(Strings.Chr(34), strRootLink, strPage);

// If hyperlink is within a label, set CSS class
if ((myLink.Parent is Label)) {
// Get reference to the label the contains the hyperlink
Label myLabel = (Label)myLink.Parent;

// Set CSS class
if ((strUrl.Contains(strPage))) {
myLabel.CssClass = cssClass1;
} else {
myLabel.CssClass = cssClass2;
}
}
}

</script> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"> 
       
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
       
<title>Untitled Page</title> 
       
<style type="text/css"> 
               
.current { 
                        font
-family:Arial, Helvetica, sans-serif; 
                        font
-size:12px;                          color:blue; 
                        background
-color:#FF0000; 
               
} 
 
               
.nav { 
                        font
-family:Arial, Helvetica, sans-serif; 
                        font
-size:12px; 
                        color
:red; 
               
} 
       
</style> 
</head> 
<body> 
       
<form id="form1" runat="server"> 
       
<div> 
               
<table> 
                       
<tr> 
                               
<td align="center"> 
                                       
<asp:Label ID="Label1" runat="server"> 
                                               
<asp:HyperLink ID="HyperLink1" runat="server"></asp:HyperLink> 
                                       
</asp:Label> 
                                       
<br /> 
                                       
<asp:Label ID="Label2" runat="server"> 
                                               
<asp:HyperLink ID="HyperLink2" runat="server"></asp:HyperLink> 
                                       
</asp:Label> 
                                       
<br /> 
                                       
<asp:Label ID="Label3" runat="server"> 
                                               
<asp:HyperLink ID="HyperLink3" runat="server"></asp:HyperLink> 
                                       
</asp:Label> 
                               
</td> 
                       
</tr> 
               
</table> 
       
</div> 
       
</form> 
</body> 
</html>

refer the links also

     http://msdn.microsoft.com/en-us/library/dddsc60w(v=vs.71).aspx
http://forums.asp.net/t/1112688.aspx/1
http://www.asp.net/downloads/archived-v11/migration-assistants/asp-to-aspnet
Jitendra Faye replied to Shiv Kant Pandey on 19-May-11 04:11 AM
ASP and ASP.NET can run side by side on an Internet Information Services (IIS) Web server without interference; there is no chance of corrupting an existing ASP application simply by installing ASP.NET. Only files with an .aspx file name extension are processed by ASP.NET; files with an .asp file name extension will continue to be processed by the existing, unchanged ASP engine. You should note, however, that session state and application state are not shared between ASP and ASP.NET pages.

follow this-

http://msdn.microsoft.com/en-us/library/dddsc60w%28v=vs.71%29.aspx