简体   繁体   中英

URL Rewriting in asp.net on iis

I Have index.aspx Page where I Have Three hyperlinks using querystring my Index.aspx Page

<a href="Index.aspx?Name=Apple">Apple</a>
<a href="Index.aspx?Name=XYZ">XYZ</a>
   <a href="Index.aspx?Name=XYZ2">XYZ2</a>

always it will be on same page but when i click on First hyperlink it is working than URl is localhost:85/StateJobs/Apple after that when i click on second time on any hyperlink url is changed localhost:85/StateJobs/StateJobs/XYZ But Its Url Will Be localhost:85/StateJobs/XYZ"

My Web.Config

enter code here

Try this one instead:

<a href='<%: ResolveUrl("~/Index.aspx?Name=Apple") %>'>Apple</a>
<a href='<%: ResolveUrl("~/Index.aspx?Name=XYZ") %>'>XYZ</a>
<a href='<%: ResolveUrl("~/Index.aspx?Name=XYZ2") %>'>XYZ2</a>

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