锚标记自己获取href
我在母版页中设置锚标记,
<a onmouseout="mclosetime()" onmouseover="mopen('m2')" id="AnchorText5" href="#">TEst</a>
但是当我运行应用程序并渲染页面时,锚标记包含 href 地址,就像
<a onmouseout="mclosetime()" onmouseover="mopen('m2')" id="ctl00_AnchorText5" href="../MasterPages/#">TEst</a>
我也尝试从后面的代码设置“#”,但它再次显示 href="../masterpages/#"
谁能知道如何解决这个问题?
i set anchor tag in masterpage as
<a onmouseout="mclosetime()" onmouseover="mopen('m2')" id="AnchorText5" href="#">TEst</a>
but when i run application and it render the page the anchor tag contain href address like
<a onmouseout="mclosetime()" onmouseover="mopen('m2')" id="ctl00_AnchorText5" href="../MasterPages/#">TEst</a>
i also try to set the "#" from code behind but it again show href="../masterpages/#"
can anyone know how to solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看客户端的id,似乎
A
标签被声明为页面上的控件,这在原始声明中没有显示,尝试使用它并看看它是否适合您:我也测试了您的
A
链接代码,它按预期工作,因此您可能会改变您的href
的行为looking at the id on the client side it appears to be as if the
A
tag was declared as a control on the page, which is not shown on the original statement, try using this and see if it works for you:I have tested your
A
link code as well and it works as expected, so you might have something changing the behaviour of yourhref
它会抓取它所在的文件夹 URL,具体取决于您导入标签的方式,它很可能会自动定向到该位置。就像您单击“插入__”并抓取桌面上的文件夹一样。它将附加一个额外的块以正确导航。我建议仔细检查您是否已手动编码此 href 并且未使用插入工具。
It's grabbing the folder url that it resides in, depending on the way you have imported the tag it's most likely automatically being directed to that location. Like when you click "Insert __" and grab the folder on your desktop. It will append an extra chunk to navigate properly. I would suggest double checking that you have coded this href by hand and not used a tool for an insert.