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

Request values from one aspx page to another

Hello there

I have a page1.aspx and an event occurence in page1.aspx pop-up page2.aspx. Now i can select some values in the dropdown lists from that page2.aspx as search criteria. Once the criteria matches the search returns a datagrid which has a select button. When I click on that button I return back to page1.aspx.

Now I need to request the selecteditem.values of the drop down lists from page2.aspx to page1.aspx as i need those two values as a input for a different event.

Can someone please help me?

Hard learner
0
hardlearner
Asked:
hardlearner
  • 4
  • 3
1 Solution
 
b1xml2Commented:
simple way is this:
1. in page2.aspx, when you are ready, populate the Session with the values you are interested in
2. when page2.aspx closes, force a postback(like document.forms[0].submit();)
3. in page1.aspx, grab the session values and do what you want server-side...
0
 
hardlearnerAuthor Commented:
Thanx buddy...
 
Would you mind a little more help...

Suppose I create two literals a & b in page2.apsx and render the values of the dropdown lists to them like the following:   dropdown1.selecteditem.value=a and dropdown2.selecteditem.value=b. How exactly can i force a postback to be able to use those two values from page1.aspx?
I will be grateful if you can elaborate...




0
 
b1xml2Commented:
depends on how you open page2.aspx...

window.open("<url>","mywindow","<features>");
means the following would work
// force postback of parent page
top.opener.document.forms[0].submit();
// close popup page
top.close();

// I use top because it is common to hold the aspx page in a popup window inside an IFRAME tag to allow postbacks to the popupwindow in dialog Windows (MSIE only)

/// window as the object is the correct code!
window.showModelessDialog("<url>",window,"<features>");
// force postback
top.dialogArguments.document.forms[0].submit();
// close popup page
top.close();

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
b1xml2Commented:
You can register call the client-side scripts when you are ready:

Page.RegisterClientScriptBlock("reload","<script>reload();</script>")

and inside the aspx page
<script language="javascript">
function reload() {
  ... code...
}
</script>

0
 
hardlearnerAuthor Commented:
hello Buddy... It surely was very helpful but I wish you were a VB.Net. Now I have to struggle for the equivalent syntax

thank you anyway
0
 
hardlearnerAuthor Commented:
Oh man... Just for your information... I am kinda new to this technology... I still have got some research to do on this now  :)

Hard learner is what i am :)

thank you
0
 
b1xml2Commented:
uhm, the code was in javascript... at the mo, nothing to do with VB.NET or C#. I am versatile across the 2 languages altho I personally prefer C#
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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