ASP.NET - Migration from ASP to - 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
Reena Jain replied to Shiv Kant Pandey on 19-May-11 03:29 AM

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

try this code
<%@ Page Language="c#" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> 
<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;

<html xmlns="" > 
<head runat="server"> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Untitled Page</title> 
<style type="text/css"> 
.current { 
-family:Arial, Helvetica, sans-serif; 
-size:12px;                          color:blue; 
.nav { 
-family:Arial, Helvetica, sans-serif; 
<form id="form1" runat="server"> 
<td align="center"> 
<asp:Label ID="Label1" runat="server"> 
<asp:HyperLink ID="HyperLink1" runat="server"></asp:HyperLink> 
<br /> 
<asp:Label ID="Label2" runat="server"> 
<asp:HyperLink ID="HyperLink2" runat="server"></asp:HyperLink> 
<br /> 
<asp:Label ID="Label3" runat="server"> 
<asp:HyperLink ID="HyperLink3" runat="server"></asp:HyperLink> 

refer the links also
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-