Click here to Skip to main content
15,908,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C#
 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:
JavaScript
$('#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
Posted
Updated 18-Feb-12 7:28am
v2
Comments
André Kraak 18-Feb-12 13:28pm    
Edited question:
Added pre tags
"Treat my content as plain text..." option disabled.
ZurdoDev 7-Mar-12 11:35am    
I would recommend using jQuery's .ajax() function instead of trying to mimic the .net postback.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900