如何将NavigateURL转换为href clientside? [英] How to convert NavigateURL to href clientside?

查看:73
本文介绍了如何将NavigateURL转换为href clientside?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<asp:HyperLink ID=&quot;hlcnm&quot; ForeColor=&quot;Blue&quot; runat=&quot;server&quot; DataTextField=&quot;CaseNo&quot;

                                        ItemStyle-Width=&quot;14%&quot; HeaderText=&quot;Incident ID&quot; DataNavigateUrlFields=&quot;ID&quot; NavigateUrl=&#39;&lt;%=&quot;../IncidentSummary.aspx?key=&quot; + CSIRT.Crypto.CryptoOperations.GetEncryptedString(&quot;ID={0}&quot;) %&gt;&#39;

                                        Text=&#39;&lt;%# DataBinder.Eval(Container.DataItem, &quot;CaseNo&quot;)%&gt;&#39; SortExpression=&quot;CaseNo&quot; /&gt;</pre>
<big></big>





请,我想将NavigateURL转换为href ...



先谢谢... ...



please ,i want to convert the NavigateURL to href ...

Thanks in advance ......

推荐答案

您不必转换任何内容。呈现页面时,您的asp:Hyperlink变为标签,NavigateURL变为href。



从服务器端获取对控件的引用可能更难控件ID被破坏,但可以通过javascript中的以下行解决。



var id =<%= hlcnm.ClientID%> ;



那么你通常可以将它用于jQuery和类似的
You don't have to convert anything. When the page is rendered, your asp:Hyperlink becomes tag with NavigateURL becoming href.

It may be harder to get the reference to the control since server side control ids get mangled, but solveable by the following line in javascript.

var id = <%=hlcnm.ClientID%> ;

Then you can normally use it for jQuery and similar


这篇关于如何将NavigateURL转换为href clientside?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆