• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

How to post back to a particular page using JavaScript

I am using Asp.net 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 Asp.net
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">
2
3 function search()
4 {
5      window.showModalDialog("PopupPage.aspx")


6
7}
8</script>
0
brgdotnet
Asked:
brgdotnet
2 Solutions
 
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.
0
 
Imran Javed ZiaCommented:
0
 
brgdotnetAuthor Commented:
Thank you
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now