回发后无法获取txtbox文本(使用jquery对话框) [英] unable to get txtbox text after postback(using jquery dialog)
本文介绍了回发后无法获取txtbox文本(使用jquery对话框)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用jQuery对话框,然后单击发送电子邮件",即发送了电子邮件,但发回邮件后,我无法获取TextBox的文本.
以下是代码:
Hi,
I am using jQuery dialog and click send email the email is sent, but I am unable to get the text of TextBox after post back.
Following is the code:
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack ==true && Page.Request["__EVENTTARGET"] == "SendReply")
{
SendReply();
}
.....
}
private void SendReply()
{
//ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "KeyToIdentifythisScript", "#dialog_link().click();", true);
string username = Membership.GetUser ().ToString ();
if (ViewState["username"]!=null )
{
body = body.Replace("<%Body%>", txtreply.Text.ToString());// here im getting the text as null
.....
}
在页面上:
while on page:
$('#dialog').dialog({
autoOpen: false,
width: 600,
buttons: {
"Send Mail": function () {
__doPostBack('SendReply', '')
// $(this).dialog("close");
},
"Cancel": function () {
$(this).dialog("close");
}
}
.....
<table class="ui-accordion">
<tr>
<td>
<p><a href="#" id="dialog_link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>Contact Information</a></p>
<!-- ui-dialog -->
<div id="dialog" title="Contact Information">
<table>
<tr>
<td>Phone Number :</td>
<td><asp:Label ID="lblContact" runat="server" /></td>
</tr>
<tr>
<td>Reply By Email :</td>
<td>
<asp:TextBox ID="txtReply" TextMode="MultiLine" runat="server"
></asp:TextBox>
</td>
</tr>
</table>
需要帮助
谢谢
Need help
Thanks
推荐答案
(' #dialog').dialog({ autoOpen: false , 宽度: 600 , 纽扣: { " :>功能() { __doPostBack(' SendReply',' ') //
('#dialog').dialog({ autoOpen: false, width: 600, buttons: { "Send Mail": function () { __doPostBack('SendReply', '') //
(this).dialog("close"); 跨度> }, " :功能(){
(this).dialog("close"); }, "Cancel": function () {
(此).dialog(" 关闭"); } } ..... < table class = " 跨度>> < tr> < td> < p>< a href = " id = 对话框链接" " ui-state-default ui-corner-all">< span "
(this).dialog("close"); } } ..... <table class="ui-accordion"> <tr> <td> <p><a href="#" id="dialog_link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>Contact Information</a></p> <!-- ui-dialog --> <div id="dialog" title="Contact Information"> <table> <tr> <td>Phone Number :</td> <td><asp:Label ID="lblContact" runat="server" /></td> </tr> <tr> <td>Reply By Email :</td> <td> <asp:TextBox ID="txtReply" TextMode="MultiLine" runat="server" ></asp:TextBox> </td> </tr> </table>
需要帮助
谢谢
Need help
Thanks
这篇关于回发后无法获取txtbox文本(使用jquery对话框)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文