开发者

Link to Homepage is forwardslash

Im have the default routing and write a link to the Homepage in my view

<a href="<%=Url.Action("Index" ,"Home")%>">Link</a>

The generated content is a forward slash.

<a href="/">Link</a>

This link works in Firefox but in IE8 no request is sent to the server when the link is clicked.

Is a forward slash a valid content in a link?

EDIT:

OMG, I tried to have an image ins开发者_JAVA百科ide the link but actually put an input type image there. The funny think is that it worked in Firefox. Thats how my linked looked like:

 <a href="/"> <input type="image" src="/Images/buttons/btn_buy_more.gif" alt="" /> </a>

I will leave this question here so you have somebody to laugh about.


Url.Action isn't supposed to send a request to the server. It just generates a link address. Look at the generated URI in the HTML source of the rendered page. I'll bet it's the same in both browsers.

What I think you mean is that clicking the link is behaving differently for you. To figure out why, use Fiddler to examine the request the browser sends and the server's response.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜