Skip to Content
ASP.NET 4 Unleashed
book

ASP.NET 4 Unleashed

by Stephen Walther, Kevin Hoffman, Nate Dudek
October 2010
Intermediate to advanced
1920 pages
73h 55m
English
Sams
Content preview from ASP.NET 4 Unleashed

Linking to Other Pages with Routes

So far we’ve looked at a bunch of ways we can get a user from a URL to a page, but what about going the other way? When the user is on an ASP.NET Web Form, how do we create links to other pages in a way that respects the URL routing scheme without giving each page “magic” knowledge of how the URLs are formatted?

Basically what we want is to keep all the URL routing logic inside the single initialization method at application startup. We never want individual Web Forms to be creating links with hard-coded strings or string concatenation because those pages would cease to work properly if the URL route maps changed.

Ideally, we want to create URLs dynamically by supplying parameters and, optionally, the name of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET 3.5 Unleashed

ASP.NET 3.5 Unleashed

Stephen Walther
ASP.NET 4.0 in Practice

ASP.NET 4.0 in Practice

Marco De Sanctis, Daniele Bochicchio, Stefano Mostarda

Publisher Resources

ISBN: 9780132565851Purchase book