TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Bindu
NA
40
63.8k
Url Routing using Route Handler
Jan 19 2013 1:14 AM
Hi.
i want to route url using route handler i tried some code but it doesn't work out.
in Global page:
RouteTable.Routes.Clear();
RouteTable.Routes.Add("MyCustomRoute", new Route("{Name}", new CustomRouteHandler("~/Index.aspx")));
and the class which implements handler is
public class CustomRouteHandler : IRouteHandler {
IHttpHandler IRouteHandler.GetHttpHandler(RequestContext requestContext)
{
string virtualPath = "~/Index.aspx";
return BuildManager.CreateInstanceFromVirtualPath(virtualPath, typeof(Page)) as IHttpHandler;
}
public bool IsReusable {
get {
return false;
}
}
}
in index page:
string a =(string) Page.RouteData.Values["Name"];
i am trying for this since four days. i cant able to understand where i am going wrong...please help me.the same code i tried in another project it is working there. i cant able to do it in my project..
Error:
HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Thanks in advance..
Reply
Answers (
0
)
How to avoid warning message in yahoo email?
Remember Password In ASP.NET