Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET C#4.0 jQuery JQueryUI , +
Hi ,
I'm unable to postback using jquery. The code was working fine week ago. I just made few more amendments in the page and checked; now it's unresponsive.
 
following is the code :
in head
<script src="../../scripts/jquery-1.6.js" type="text/javascript"></script>
	<link href="../../styles/jquery-ui-1.8.17.custom.css" rel="stylesheet" type="text/css" />
	<script src="../../scripts/jquery-ui-1.8.17.custom.min.js" type="text/javascript"></script>
<script src="../../scripts/jquery.jqzoom-core-pack.js" type="text/javascript"></script>
<link rel="stylesheet" href="../../styles/jquery.jqzoom.css" type="text/css"/> 
 

in content panel :
<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>
 
in code behind :
protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Form["MethodName"] == "SendReply")
        {
            var a = Request.Form["Reply"].ToString();
            SendReply(a);
        }
..
}
 
dialog code  in script tag :
 $(document).ready(function () {
         $('#dialog').dialog({
            autoOpen: false,
            modal: true,
            show: "slide",
            width: 600,
            buttons: {
                "Send Mail": function () {
                    var dataToSend = { MethodName: 'SendReply', Reply: document.getElementById('<%= txtReply.ClientID %>').value };
                    var id = $.readQS('productId');
                    var options =
                        {
                            url: '<%=ResolveUrl(string.Format("~/classifieds/details/generalDetails.aspx?productId={0}", Request.QueryString["productId"])) %>',
                            data: dataToSend,
                            dataType: 'JSON',
                            type: 'POST',
                            success: function () { $(this).dialog("close"); }
                        };
                        $.ajax(options);
 
                        
 
                },
                "Cancel": function () {
                    $(this).dialog("close");
                }
            }
            });
 

 
Posted 13-Mar-12 20:56pm
(unknown member)
Edited 14-Mar-12 9:49am
v3
Comments
V. at 14-Mar-12 9:08am
   
What should trigger the postback? Is there a button? Does it perform the postback (and it hangs during that postback) or is it even before postback that page becomes unresponsive?
shan786786 at 14-Mar-12 15:50pm
   
Hi , i have updated the dialog box code in script tag
V. at 15-Mar-12 3:01am
   
"I just made few more amendments in the page and checked" -> Do you still remember those ammendments? Remove them and check, then add one by one and check each time.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 345
1 _Amy 210
2 Peter Leow 175
3 Nirav Prabtani 167
4 Andreas Gieriet 160
0 OriginalGriff 7,540
1 Sergey Alexandrovich Kryukov 6,597
2 Maciej Los 3,849
3 Peter Leow 3,653
4 CHill60 2,712


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 14 Mar 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100