本文介绍了如何在Linkbutton上应用jQuery函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个jquery表单,可在页面上弹出一条消息.我有一个要在Linkbutton上设置的jquery函数.
目前我有:
I have a one jquery form that pops up a message on the page. I have one jquery function which I want set on Linkbutton.
Currently I have :
<li onclick="TINY.box.show({iframe:'User_News.aspx',boxid:'frameless',width:250,height:250,fixed:false,maskid:'bluemask',maskopacity:40,closejs:function(){closeJS()}})" style="color: #0000FF; font-size: medium; height: 28px;" id="l1" runat="server">View Message
我想将此功能设置到c#的Linkbutton上.
I want to set this function onto the Linkbutton of c#.
推荐答案
<%@ page language="C#"%>
<script runat="server">
void LinkButton1_Click (object sender, EventArgs e)
{
Label1.Text = "Thank you for visiting our site.";
}
</script>
<html>
<head id="Head1" runat="server">
<title>LinkButton.OnClientClick Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>LinkButton.OnClientClick Example</h3>
<br />
<h4>Click to navigate to Microsoft.com:</h4>
<br />
<asp:linkbutton id="LinkButton1"
text="Open Web site"
onclientclick="Navigate()"
onclick="LinkButton1_Click"
runat=Server />
<br /><br />
<asp:label id="Label1"
runat=Server>
</asp:label>
</form>
<script language=javascript>
function Navigate()
{
javascript:window.open("http://www.microsoft.com");
}
</script>
</body>
</html>
<asp:linkbutton id="LinkButton1"
text="Open Web site"
onclick="LinkButton1_Click"
runat="Server" />
< script>
<script>
这篇关于如何在Linkbutton上应用jQuery函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!