c# - 404 Error While URL Routing with asp.net web Forms -
i implementing url routing in asp.net web forms. this mapping class
public class routeconfig { public static void registerroutes(routecollection routes) { routes.mappageroute( "user", "users/{id}", "~/modules/usermgmt/users.aspx"); routes.mappageroute( "leave", "leaveapply/{id}", "~/modules/leavemgmt/leaveapply.aspx"); } }
i calling method in application start
void application_start(object sender, eventargs e) { routeconfig.registerroutes(routetable.routes); }
and anchor tag
<a href="/users/18">users</a>
its working fine when configure project "use visual studio development server" project properties.
and working fine shown below
when configure run project "use local iis web server" project properties. ie)
i getting error shown below
the route directory or project name(created when configure "use local iis web server" ) missing while routing. when put directory name add directly url browser working. shown below.
could please me solve problem.
your routing working fine, other wise havn't see results localhost/urlrouting/users/18 however, there no website listening 'localhost' address.
if want use localhost, open iis manager, create website under root , map project physical folder.
remove 'urlrouting' project web properties
Comments
Post a Comment