如何调用锚标签单击asp.net代码 [英] How to call anchor tag click asp.net code

查看:82
本文介绍了如何调用锚标签单击asp.net代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的团队,



我的asp.net网页上有一个锚标记如果用户点击锚标记某个逻辑执行了他们的结束,这个锚从另一个域获取我希望在锚定点击之后在我们这边做一些代码那么如何通过锚标记调用服务器端代码单击

Dear Team,

I have a anchor tag in my asp.net webpage this anchor getting from another domain if user click the anchor tag some logic executed their end.I want to do some code in our side after the anchor click So how can we call server side code through anchor tag click

推荐答案

首先在页面上添加scriptmanager

为你的锚添加以下属性

first add scriptmanager on your page
add below attribute for your anchor
onclick="__doPostBack('anchorClick','');"





代码隐藏在页面后面



at code behind page

if(Request["__EVENTTARGET"]=="anchorClick")
{
// your logic
}


HI Pravee n

锚标记不在网页中我们从其他网站获取此标记,但它在我们的网页中呈现
HI Praveen
anchor tag is not in web page this tag we getting from another web site but it render in our webpage


这篇关于如何调用锚标签单击asp.net代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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