How to post back to a particular page using JavaScript

I am using with Java Script.

I have a java script method in my master page named "search".
When search is called I display a popup window. When that window
closes, I would like to transfer the user to a specific
page. Let's call that page "default.aspx"

So how do I transfer to the default.aspx page using Java script? This
would probably be done at line 6 below, but I don't know how to do it.

Note that if search is performed 50 times, I don't want 50 default.apx
windows open. I just want one default.aspx window open.

So somehow I need to always post back to "default.aspx"

1  <script type="text/javascript">
3 function search()
4 {
5      window.showModalDialog("PopupPage.aspx")

Who is Participating?
Julian HansenCommented:
When you close your modal dialog do as follows
window.location = "default.aspx";

Open in new window

Although I am not certain this is what you want. You have left some gaps in your description so subject to misinterpretation.
If I read between the lines it sounds like you want the dialog to capture search criteria and you want to post these back to default.aspx.

The way your question is phrased it sounds like you just want to  send the user to another page - in which case window.location is the way to do that.

If you actually want to post something back you have to populate some form variables with jscript and then invoke the postback action on the page.
Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
brgdotnetcontractorAuthor Commented:
Thank you
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.