I have following code inside my asp.net repeater inside itemtemplate.
<a runat = "server" href = "StoreCategory/testing.aspx">dsdsdsd</a>
Now, I would think that this link would point to mydomain.com/StoreCategory/testing.aspx (which it does if r开发者_Go百科unat = "server" is not in there)
However, if I keep runat = "server" there, the link turns out to be mydomain.com/testing.aspx. It drops StoreCategory! Why do you think it is doing that?
I figured out part of the problem, the reason is the current page is StoreCategory.aspx. However, why only runat = "server" is getting confused and how to tell it not to get confused is beyond me, hmm.
Hai,
Have you tried using asp:linkbutton with postbackUrl property
Use
<asp:LinkButton ID="lb" runat="server" PostBackUrl="StoreCategory/testing.aspx" Text="dsdsdsd"></asp:LinkButton>
Hai progtick,
Have a look at this it would help you Is Adding runat="server" to HTML tags to get relative path in ASP.net an elegant solution?
精彩评论