Click here to Skip to main content
15,919,749 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to call a function in page without postback with ajax.This call should be done after closing a popup window. in that window i add some record to a session and in parent page i should show those record in a datagridview. how can i do that?
this is js code for opening popup window.
JavaScript
function ShowDialog() {
var ret = window.showModalDialog("ReceiverPage.aspx", "MyWindow", "dialogWidth:1000px; dialogHeight:600px; resizable:no; ");
        ret = true;
        if (ret) {
            javascript:__doPostBack('<%= Button1.ClientID %>', 'onclick');            
            return true;
        }
    }



Thanks in advanced.
Posted
Updated 20-Aug-13 3:47am
v2
Comments
What have you tried?

Write a javascript function which will be called when you closes the popup and in that function call a webmethod using jquery. write your logic(add some value to session)...

hope this helps.
 
Share this answer
 
You can use AJAX to perform calls back to the server side C# code, if you want to avoid the Postback, this is commonly done when you wish to give the user the steady feeling of a flowing application rather than a page based behavior.

See tutorial: Using jQuery for AJAX in ASP.NET[^]

Cheers,
Edo
 
Share this answer
 
 
Share this answer
 

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