Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the bi-directional Routing support in ASP.NET Web Forms 4.0?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you what two-way Routing support is in ASP.NET Web Forms 4.0. it is concise and easy to understand, and it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Channel 9 has just released a new 10-4 video showing how to use this new feature in ASP.NET 4.0.

Here is a piece of code shown in the video. They used a classic example to show how to map Product.aspx?category=Jerseys to Product/Jerseys. When using the ASP.NET Routing engine, we can add this mapping to RouteTable in Application_Start:

RouteTable.Routes.Add ("Product", new Route ("Product/ {name}", new PageRouteHandler ("~ / Product.aspx")

At present, in order to get bi-directional Routing support, users must rewrite Query String URL. However, when using ASP.NET 4.0, users can register the following expression constructor (expression builder):

* the expression is used to generate the URL and the second expression is used to get the route value. You can use the $symbol in the aspx page to access the expression:

If you want to get the value in the name property, you can use the Route object instead of the Request object:

RouteData.Values ["name"]

Or use the expression constructor:

Users can use the ASP.NET Routing engine and new bidirectional support to decouple URL from physical Web Form to support URL, which is more search engine friendly.

The above is what two-way Routing support is like in ASP.NET Web Forms 4.0. have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report