Jquery模式弹出按钮未触发 [英] Jquery modal popup button is not triggering
本文介绍了Jquery模式弹出按钮未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这里OK按钮没有触发如何调用此按钮点击事件?
我尝试过:
Here the OK Button is not firing how can i call this button click event?
What I have tried:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" MasterPageFile="~/AdminPanel/Admin.Master" Inherits="SSTeleCallerApp.WebForm2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<title>Untitled Page</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("[id*=Button2]").live("click", function () {
$("#dialog").dialog({
modal:true,
buttons: {
Ok: function () {
$("#<%=Button3.ClientID %>").click();
},
Close: function () {
$(this).dialog('close');
}
}
});
});
});
</script>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<input type="button" id="Button2" value="click here" name="Button2" />
<asp:Button ID="Button3" runat="server" Text="Button" style="display:none;" OnClick = "Button_Click"/>
<div id="dialog">
<asp:Label ID="Label1" runat="server" Text="Enter ur name">
<asp:TextBox ID="TextBox1" runat="server" Text="karur">
</div>
<pre lang="c#">
protected void Button_Click(object sender,EventArgs e)
{
ClientScript.RegisterStartupScript(Page.GetType(),key,alert('Button)点击'),true);
}
protected void Button_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(Page.GetType(), "key", "alert('Button Clicked')", true);
}
推荐答案
( function (){
( [id * = Button2])。live( click, function (){
("[id*=Button2]").live("click", function () {
( #dialog)。对话框({
模态: true ,
按钮:{
确定: function (){
("#dialog").dialog({ modal:true, buttons: { Ok: function () {
这篇关于Jquery模式弹出按钮未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文