Pass a parameter from one page to the other page with iFrame tag

G

Guest

Hello,

I'm still using the Framework v1.1. Forgive me, I'm working on a legacy
application.
I'm using 2 iFrame sections with 2 aspx pages, i.e. 1.aspx (left) and 2.aspx
(right)
In 1.appx page, I have a treeview control, I'd like to pass a selected node
string to 2.aspx page and then to display some contents with passed node
string.
How could I accomplish that? The task is to pass the string parameter and
then invoke the 2.aspx page to refresh the display.

I'd appreciate for getting any help.
 
G

Guest

If you've got two separate .aspx pages each loaded into an IFRAME, and you
need for the second page to get a querystring parameter when something
happens in the first, then you have to make the second IFRAME reload it's
page, with the querystring appended at the end so your code in your second
page's Page_Load handler can check for it and react. Right?
So, you could either try making the second IFRAME runat=server and reset
it's src property, or you could do it with client script with something *like*

document.Frames[1].src="xxxx?id=yyyy";

Peter
 
G

Guest

Hi, Peter,

Very appreciate for your reply!

I'd prefer using the code behind pattern. Could you please show me the
syntax in C#? The following is my code example:

From 1.aspx, user selected a node from a treeview control:

private void OrganTree_SelectedIndexChange(object sender,
Microsoft.Web.UI.WebControls.TreeViewSelectEventArgs e)
{
string NodeCode = e.NewNode.ToString();
}

From 2.aspx, I'd expect to get the selected tree node string.

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
if( !IsPostBack )
{
}
}

My question is how to trigger 2.aspx to react from 1.aspx after a user action?

Thank you so much!
bbsbob
--
Doing software as simple as possible


Peter Bromberg said:
If you've got two separate .aspx pages each loaded into an IFRAME, and you
need for the second page to get a querystring parameter when something
happens in the first, then you have to make the second IFRAME reload it's
page, with the querystring appended at the end so your code in your second
page's Page_Load handler can check for it and react. Right?
So, you could either try making the second IFRAME runat=server and reset
it's src property, or you could do it with client script with something *like*

document.Frames[1].src="xxxx?id=yyyy";

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




bbsbob said:
Hello,

I'm still using the Framework v1.1. Forgive me, I'm working on a legacy
application.
I'm using 2 iFrame sections with 2 aspx pages, i.e. 1.aspx (left) and 2.aspx
(right)
In 1.appx page, I have a treeview control, I'd like to pass a selected node
string to 2.aspx page and then to display some contents with passed node
string.
How could I accomplish that? The task is to pass the string parameter and
then invoke the 2.aspx page to refresh the display.

I'd appreciate for getting any help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top