c# - Parsing Friendly Routed URL Parameter -
i have links in listview going detailed page view (not mvc):
http://localhost/mysite/events.aspx?eventid=14 after implementing routing, link in form:
http://localhost/mysite/events/14 what's best way parse/obtain eventid value in events.aspx code-behind , how should/would check make sure value passed?
i figured out , leaving question others refer to:
if (!page.ispostback) { if (page.routedata.values["eventid"] != null) { int eventid = convert.toint32(page.routedata.values["eventid"]); } }
Comments
Post a Comment