简体   繁体   中英

RouteUrl not working when site is published in Asp.net

I had this code in my link

 <a href="<%$RouteUrl:City=Islamabad %>" runat="server" >Islamabad</a>

Its not routing url. The link is just unclickable. I had tried changing to and but still no luck. I had all 3 of them working during offline run through Visual Studio but same site is not working in live.

What I think is the web.config file is not updated in production environment

<%$ %> is an ASP.NET Expression Builder. Used for runtime expression binding for control properties through the server tag attributes. Used with AppSettings, ConnectionStrings, or Resources (or your own custom extension, for example to use code-behind properties). These assignments are added to the OnInit() method of the generated class.

Please refer the below articles for complete understanding of Expression builder in asp.net

Expressions Overview

Creating custom ExpressionBuilder Class as you used in your above code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM