如何从客户端到服务器端获取Href值
问题描述:
大家好:
有人能帮帮我吗?我需要在点击时从href获取服务器端的值,例如点击GO A,得到〜/ webforms / aaaa.aspx并传递到服务器端
Hello to everyone:
Can someone help me? I need to get the value in server side from href when is click , example click on "GO A",get "~/webforms/aaaa.aspx" and pass to server side
<ul runat="server" id="options" class="nav">
<li class="dropdown">
<a id="aaaa" runat="server" href="~/webforms/aaaa.aspx" title="Inicio">GO A</a>
</li>
<li class="dropdown">
<a id="bbbbb" runat="server" href="~/webforms/bbbbb.aspx">GO B </a>
</li>
<li class="dropdown">
<a iid="cccccccc" runat="server" href="~/webforms/cccccccc.aspx">GO C </a>
</li>
<li class="dropdown">
<a id="dddddd" runat="server" href="~/webforms/dddddd.aspx">GO D</a>
</li>
</ul>
我该怎么做?
谢谢
How can I do this?
Thanks
答
HttpRequest类 [ ^ ]具有各种属性读取当前请求的路径。
例如,AppRelativeCurrentExecutionFilePath
属性 [ ^ ]将为您提供app-relative当前页面的路径 - 例如:〜/ webforms / aaaa.aspx
。
The HttpRequest class[^] has various properties to read the path of the current request.
For example, theAppRelativeCurrentExecutionFilePath
property[^] will give you the app-relative path for the current page - eg:"~/webforms/aaaa.aspx"
.