Rajveer singh

Rajveer singh

  • 768
  • 1k
  • 241k

URL Routing In asp.net

Aug 4 2015 2:21 PM
 Hi all,
         
                I am using 4.0 .net framework  and make url rouing and here my simple code:
 
   
<%@ Application Language="C#" %>
<%@ Import Namespace="System.Web.Routing" %>
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
registerrout(RouteTable.Routes);
}
void registerrout( RouteCollection rout)
{
rout.MapPageRoute("Hello", "Hello", "~/Default.aspx");
}
 
and call this page on click event: 
 
protected void btn_Click(object sender, EventArgs e)
{
Response.Redirect("Hello");
}
 
 this code run sucessfully on local mahine
 
 
but this file upload on IIS or FTP so error

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

 
 
So tell me correct way to url routing in asp.net 4.0
 
Thanks
 
Rajveer Singh 
 
 

Answers (3)