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.

enter image description here

and working fine shown below

enter image description here

when configure run project "use local iis web server" project properties. ie)

enter image description here

i getting error shown below enter image description here

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.

enter image description here

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

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -