Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
483 Points
445 Posts
Jan 10, 2011 09:18 PM|LINK
hello all , I am writing this code
in global.asax to save routes
RouteTable.Routes.Add("Profile", new Route("Profile/{ID}", new ProfileHandler("~/Member/Profile.aspx")));
and then writing this in the handler
var display = BuildManager.CreateInstanceFromVirtualPath(_virtualPath,typeof(Page)) as Profile;
//Setting Page Parameters
display.MemberId = Convert.ToInt32(requestContext.RouteData.Values["ID"]);
But I dont like this code , I am mean first I am writing hardcoded things , second what If my website is online and I want to republish it?? I'll have to stop iis , any other ideas to save them??
Mazenx
Member
483 Points
445 Posts
url routing where to save routes?!
Jan 10, 2011 09:18 PM|LINK
hello all , I am writing this code
in global.asax to save routes
RouteTable.Routes.Add("Profile", new Route("Profile/{ID}", new ProfileHandler("~/Member/Profile.aspx")));
and then writing this in the handler
var display = BuildManager.CreateInstanceFromVirtualPath(_virtualPath,typeof(Page)) as Profile;
//Setting Page Parameters
display.MemberId = Convert.ToInt32(requestContext.RouteData.Values["ID"]);
But I dont like this code , I am mean first I am writing hardcoded things , second what If my website is online and I want to republish it?? I'll have to stop iis , any other ideas to save them??