访问jquery弹出窗口中的文本框文本值到页面后面的代码 [英] access textbox text value in jquery popup to code behind page

查看:137
本文介绍了访问jquery弹出窗口中的文本框文本值到页面后面的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用模式弹出窗口,其中我有一个文本框,单击发送按钮它正在执行代码隐藏功能但不获取文本框值。



< pre lang =Javascript>< link type = text / css rel = stylesheet href = http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css />
< script type = text / javascript src = http://code.jquery.com/jquery-1.8.2.js>< / script>
< script type = text / javascript src = http://code.jquery.com/ui/1.10.3/jquery-ui.js>< /脚本>
< script type = text / javascript>
$( function (){
$(' #btnclick')。click( function (){
$( #popupdiv)。dialog({
title: 将详细信息发送到电子邮件地址
宽度: 400
height: 200
modal: true
按钮:{
发送: function (){
$( [id * = but_send])。click();
},
关闭: function (){
$( this )。dialog(' close');
}
}
});
});
})
< / script>



 <   div     id   =  popupdiv    title   = 基本模态对话框    style   =  display:无 >  
输入电子邮件地址
< asp:TextBox ID = txt_email runat = server class = textcss > < / asp:TextBox >
< asp:标签 ID = lbl_status runat = server CssClass = red 文字 = > < / asp:标签 >
< / div >
< asp:按钮 ID = but_send runat = server 文本 = 发送 样式 = display:none OnClientClick = return sendvalidate(); onclick = but_send_Click / >



  protected   void  but_send_Click( object  sender,EventArgs e)
{
string email = txt_email.Text;
}

解决方案

function (){


' #btnclick')。click( function (){


#popupdiv)。dialog({
title: 将详细信息发送到电子邮件地址
宽度: 400
height: 200
模态: true
按钮:{
发送:功能( ){


I am using modal popup in which i have one textbox, On click on send button it is executing the code behind functionality but not fetching textbox value.

<link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <script type="text/javascript">
        $(function () {
        $('#btnclick').click(function () {
            $("#popupdiv").dialog({
                title: "Send details to email address",
                width: 400,
                height: 200,
                modal: true,
                buttons: {
                    Send: function () {
                        $("[id*=but_send]").click();
                    },
                    Close: function () {
                        $(this).dialog('close');
                    }
                }
            });
        });
    })
    </script>


<div id="popupdiv" title="Basic modal dialog" style="display: none">
Enter email address
<asp:TextBox ID="txt_email" runat="server" class="textcss" ></asp:TextBox>
<asp:Label ID="lbl_status" runat="server" CssClass="red" Text=""></asp:Label>
</div>
<asp:Button ID="but_send" runat="server" Text="Send" style = "display:none" OnClientClick="return sendvalidate();" onclick="but_send_Click" />


protected void but_send_Click(object sender, EventArgs e)
    {
        string email = txt_email.Text;
    }

解决方案

(function () {


('#btnclick').click(function () {


("#popupdiv").dialog({ title: "Send details to email address", width: 400, height: 200, modal: true, buttons: { Send: function () {


这篇关于访问jquery弹出窗口中的文本框文本值到页面后面的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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