How to pass value from parent page to pop up without using querystring

If you want pass some value from parent page to pop up without using query string then you can pass it as argument.

Take this example

For modalDialogue:


var retnBlood = window.showModalDialog("path of the pop up page, pass your argument, "status:No;dialogHeight:400px;dialogWidth:600px;resizable:0;scrollbars:1;center:yes");


You can find the value of argument in modal dialogue by this code

For Modal Dialogue:

function Show()
{
var argVal = window.dialogArguments;
//save it in a hiddenfield as use it
}

Call this function at pageload using below code

protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>Show();</script>");

}


If you are using simple pop up instead of modal dialogue then use like below

function Show()
{
var argVal = Window.opener;
//save it in a hiddenfield as use it
}





Thanks,
Abhay


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: