i put this in Global.asax.cs
routes.MapWebFormRoute("Page", "Page/{*anything}", "~/Page.aspx", false);
how i can get value of {*anything} in Page.aspx
i'm using WebFormRouting from codeplex
For WebFormRouting, you should check out this blog post by Phil Haack:
Using Routing With WebForms
http://haacked.com/archive/2008/03/11/using-routing-with-webforms.aspx
He says that, if your Web Form Page
implements the IRouteable
interface, the WebFromRouteHandler
class can pass it the RequestContext
. Once this is done, you should be able to:
string value = Page.RouteData.Values["anything"];
There is a sample project at the blog post.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With