Connecting Tech Pros Worldwide Help | Site Map

Is it possible to access another Page in code-behind

Dan
Guest
 
Posts: n/a
#1: Nov 18 '05
We have a simple site. It's a frameset with two frames a left and a right.
The left frame is essentially a list of records from a database (using a
server-side repeater control). When you click on one of the items in the
left frame, it targets the right frame and displays a form prefilled with
information for the item you clicked.

The problem is the left frame's list just shows the names of the items, and
the name of the item is editable in the right frame. So if I change the
name of the item in the right frame and save, I need it to automatically
update item's name in the left frame. How can I accomplish this?

Is there is a way to accomplish this through server side code?

Right now we're doing a clunky javascript solution which works, but I'm
hoping there is a better way. Basically in the save event for the right
frame (in the code-behind page), after the item is saved, we redirect to a
page that says "Your information has been saved" (or something to that
effect). On this page's body's onload event (in the <body> tag, i.e.
client-side) we are targetting the left frame to refresh with javascript.
It works, but like I said it seems clunky.

Is there anyway in the save event for the right frame (in the code-behind
page), to tell the left frame to refresh.

Thanks in advance,
Dan


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003


Jason S
Guest
 
Posts: n/a
#2: Nov 18 '05

re: Is it possible to access another Page in code-behind


Dan,

I'm not sure why this seams clunky... that is the way I woud do it. No, you
cannot control a user's window refresh from the server - although you could
resend the entire frameset. Same result.

Regards,
Jason S.

"Dan" <dhartley@somewhere.com> wrote in message
news:#bsjK72uDHA.2148@TK2MSFTNGP12.phx.gbl...[color=blue]
> We have a simple site. It's a frameset with two frames a left and a[/color]
right.[color=blue]
> The left frame is essentially a list of records from a database (using a
> server-side repeater control). When you click on one of the items in the
> left frame, it targets the right frame and displays a form prefilled with
> information for the item you clicked.
>
> The problem is the left frame's list just shows the names of the items,[/color]
and[color=blue]
> the name of the item is editable in the right frame. So if I change the
> name of the item in the right frame and save, I need it to automatically
> update item's name in the left frame. How can I accomplish this?
>
> Is there is a way to accomplish this through server side code?
>
> Right now we're doing a clunky javascript solution which works, but I'm
> hoping there is a better way. Basically in the save event for the right
> frame (in the code-behind page), after the item is saved, we redirect to a
> page that says "Your information has been saved" (or something to that
> effect). On this page's body's onload event (in the <body> tag, i.e.
> client-side) we are targetting the left frame to refresh with javascript.
> It works, but like I said it seems clunky.
>
> Is there anyway in the save event for the right frame (in the code-behind
> page), to tell the left frame to refresh.
>
> Thanks in advance,
> Dan
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003
>
>[/color]


Dan
Guest
 
Posts: n/a
#3: Nov 18 '05

re: Is it possible to access another Page in code-behind


Thanks for the response.

The real reason for wanting a better solution is because our application is
actually a lot more complicated than I posted originally but the same
principle applies. In our project, the list in the left frame is actually a
treeview, and the goal is to update the treenode's text with the appropriate
changes, while at the same time keeping the treeview's state by remembering
what nodes are expanded.

It's basically like the windows explorer and how it deals with files and
folders.

If I simply refresh the left frame, the entire treeview must be reloaded
from scratch and no state is able to be kept (the user is forced to drill
down to get to where they were before).

I was hoping there was a way to simple reference the left frame's treeview
and change it from the code-behind page of the right frame. There are other
options that I've considered which require much more work, but I thought I'd
see if there was an easier way before I started coding with those.

Thanks,
Dan


"Jason S" <someone@somewhere.com> wrote in message
news:e0maEU3uDHA.2448@TK2MSFTNGP09.phx.gbl...[color=blue]
> Dan,
>
> I'm not sure why this seams clunky... that is the way I woud do it. No,[/color]
you[color=blue]
> cannot control a user's window refresh from the server - although you[/color]
could[color=blue]
> resend the entire frameset. Same result.
>
> Regards,
> Jason S.
>
> "Dan" <dhartley@somewhere.com> wrote in message
> news:#bsjK72uDHA.2148@TK2MSFTNGP12.phx.gbl...[color=green]
> > We have a simple site. It's a frameset with two frames a left and a[/color]
> right.[color=green]
> > The left frame is essentially a list of records from a database (using a
> > server-side repeater control). When you click on one of the items in[/color][/color]
the[color=blue][color=green]
> > left frame, it targets the right frame and displays a form prefilled[/color][/color]
with[color=blue][color=green]
> > information for the item you clicked.
> >
> > The problem is the left frame's list just shows the names of the items,[/color]
> and[color=green]
> > the name of the item is editable in the right frame. So if I change the
> > name of the item in the right frame and save, I need it to automatically
> > update item's name in the left frame. How can I accomplish this?
> >
> > Is there is a way to accomplish this through server side code?
> >
> > Right now we're doing a clunky javascript solution which works, but I'm
> > hoping there is a better way. Basically in the save event for the right
> > frame (in the code-behind page), after the item is saved, we redirect to[/color][/color]
a[color=blue][color=green]
> > page that says "Your information has been saved" (or something to that
> > effect). On this page's body's onload event (in the <body> tag, i.e.
> > client-side) we are targetting the left frame to refresh with[/color][/color]
javascript.[color=blue][color=green]
> > It works, but like I said it seems clunky.
> >
> > Is there anyway in the save event for the right frame (in the[/color][/color]
code-behind[color=blue][color=green]
> > page), to tell the left frame to refresh.
> >
> > Thanks in advance,
> > Dan
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003
> >
> >[/color]
>
>[/color]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003


Jason S
Guest
 
Posts: n/a
#4: Nov 18 '05

re: Is it possible to access another Page in code-behind


Ah, see, you didn't represent the entire problem. If I were you I would
save the path in the viewstate so that if I had to refresh it I could come
back to that area for the user. A la MSDN library
(msdn.microsoft.com/library).

As far as accessing the page across the frame from another page on the
server I really don't see that. It's an interesting question from the
perspective of the container page though. I don't know if you could make
the framesets runat=server or not but that may be a way.

Regards,
Jason

"Dan" <dhartley@somewhere.com> wrote in message
news:ey#DmO4uDHA.2136@TK2MSFTNGP10.phx.gbl...[color=blue]
> Thanks for the response.
>
> The real reason for wanting a better solution is because our application[/color]
is[color=blue]
> actually a lot more complicated than I posted originally but the same
> principle applies. In our project, the list in the left frame is actually[/color]
a[color=blue]
> treeview, and the goal is to update the treenode's text with the[/color]
appropriate[color=blue]
> changes, while at the same time keeping the treeview's state by[/color]
remembering[color=blue]
> what nodes are expanded.
>
> It's basically like the windows explorer and how it deals with files and
> folders.
>
> If I simply refresh the left frame, the entire treeview must be reloaded
> from scratch and no state is able to be kept (the user is forced to drill
> down to get to where they were before).
>
> I was hoping there was a way to simple reference the left frame's treeview
> and change it from the code-behind page of the right frame. There are[/color]
other[color=blue]
> options that I've considered which require much more work, but I thought[/color]
I'd[color=blue]
> see if there was an easier way before I started coding with those.
>
> Thanks,
> Dan
>
>
> "Jason S" <someone@somewhere.com> wrote in message
> news:e0maEU3uDHA.2448@TK2MSFTNGP09.phx.gbl...[color=green]
> > Dan,
> >
> > I'm not sure why this seams clunky... that is the way I woud do it. No,[/color]
> you[color=green]
> > cannot control a user's window refresh from the server - although you[/color]
> could[color=green]
> > resend the entire frameset. Same result.
> >
> > Regards,
> > Jason S.
> >
> > "Dan" <dhartley@somewhere.com> wrote in message
> > news:#bsjK72uDHA.2148@TK2MSFTNGP12.phx.gbl...[color=darkred]
> > > We have a simple site. It's a frameset with two frames a left and a[/color]
> > right.[color=darkred]
> > > The left frame is essentially a list of records from a database (using[/color][/color][/color]
a[color=blue][color=green][color=darkred]
> > > server-side repeater control). When you click on one of the items in[/color][/color]
> the[color=green][color=darkred]
> > > left frame, it targets the right frame and displays a form prefilled[/color][/color]
> with[color=green][color=darkred]
> > > information for the item you clicked.
> > >
> > > The problem is the left frame's list just shows the names of the[/color][/color][/color]
items,[color=blue][color=green]
> > and[color=darkred]
> > > the name of the item is editable in the right frame. So if I change[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > name of the item in the right frame and save, I need it to[/color][/color][/color]
automatically[color=blue][color=green][color=darkred]
> > > update item's name in the left frame. How can I accomplish this?
> > >
> > > Is there is a way to accomplish this through server side code?
> > >
> > > Right now we're doing a clunky javascript solution which works, but[/color][/color][/color]
I'm[color=blue][color=green][color=darkred]
> > > hoping there is a better way. Basically in the save event for the[/color][/color][/color]
right[color=blue][color=green][color=darkred]
> > > frame (in the code-behind page), after the item is saved, we redirect[/color][/color][/color]
to[color=blue]
> a[color=green][color=darkred]
> > > page that says "Your information has been saved" (or something to that
> > > effect). On this page's body's onload event (in the <body> tag, i.e.
> > > client-side) we are targetting the left frame to refresh with[/color][/color]
> javascript.[color=green][color=darkred]
> > > It works, but like I said it seems clunky.
> > >
> > > Is there anyway in the save event for the right frame (in the[/color][/color]
> code-behind[color=green][color=darkred]
> > > page), to tell the left frame to refresh.
> > >
> > > Thanks in advance,
> > > Dan
> > >
> > >
> > > ---
> > > Outgoing mail is certified Virus Free.
> > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003
> > >
> > >[/color]
> >
> >[/color]
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003
>
>[/color]


Dan
Guest
 
Posts: n/a
#5: Nov 18 '05

re: Is it possible to access another Page in code-behind


Thanks for the help.

I ended up having the right frame post, save, set a couple session
variables, and redirect to a page whose onload event submits the left frame.
The left frame then recursively loops through the treenodes until it finds
the one that has been edited (comparing its id with that of 1 of the session
variables), and changes its text to the new text (from the other session
variable). This way the tree keeps its state (remembering which branches
were expanded) and the text of the node changes appropriately. Still wish
there was a better way though.

Thanks,
Dan


"Jason S" <someone@somewhere.com> wrote in message
news:eyMBmZavDHA.1872@TK2MSFTNGP09.phx.gbl...[color=blue]
> Ah, see, you didn't represent the entire problem. If I were you I would
> save the path in the viewstate so that if I had to refresh it I could come
> back to that area for the user. A la MSDN library
> (msdn.microsoft.com/library).
>
> As far as accessing the page across the frame from another page on the
> server I really don't see that. It's an interesting question from the
> perspective of the container page though. I don't know if you could make
> the framesets runat=server or not but that may be a way.
>
> Regards,
> Jason
>
> "Dan" <dhartley@somewhere.com> wrote in message
> news:ey#DmO4uDHA.2136@TK2MSFTNGP10.phx.gbl...[color=green]
> > Thanks for the response.
> >
> > The real reason for wanting a better solution is because our application[/color]
> is[color=green]
> > actually a lot more complicated than I posted originally but the same
> > principle applies. In our project, the list in the left frame is[/color][/color]
actually[color=blue]
> a[color=green]
> > treeview, and the goal is to update the treenode's text with the[/color]
> appropriate[color=green]
> > changes, while at the same time keeping the treeview's state by[/color]
> remembering[color=green]
> > what nodes are expanded.
> >
> > It's basically like the windows explorer and how it deals with files and
> > folders.
> >
> > If I simply refresh the left frame, the entire treeview must be reloaded
> > from scratch and no state is able to be kept (the user is forced to[/color][/color]
drill[color=blue][color=green]
> > down to get to where they were before).
> >
> > I was hoping there was a way to simple reference the left frame's[/color][/color]
treeview[color=blue][color=green]
> > and change it from the code-behind page of the right frame. There are[/color]
> other[color=green]
> > options that I've considered which require much more work, but I thought[/color]
> I'd[color=green]
> > see if there was an easier way before I started coding with those.
> >
> > Thanks,
> > Dan
> >
> >
> > "Jason S" <someone@somewhere.com> wrote in message
> > news:e0maEU3uDHA.2448@TK2MSFTNGP09.phx.gbl...[color=darkred]
> > > Dan,
> > >
> > > I'm not sure why this seams clunky... that is the way I woud do it.[/color][/color][/color]
No,[color=blue][color=green]
> > you[color=darkred]
> > > cannot control a user's window refresh from the server - although you[/color]
> > could[color=darkred]
> > > resend the entire frameset. Same result.
> > >
> > > Regards,
> > > Jason S.
> > >
> > > "Dan" <dhartley@somewhere.com> wrote in message
> > > news:#bsjK72uDHA.2148@TK2MSFTNGP12.phx.gbl...
> > > > We have a simple site. It's a frameset with two frames a left and a
> > > right.
> > > > The left frame is essentially a list of records from a database[/color][/color][/color]
(using[color=blue]
> a[color=green][color=darkred]
> > > > server-side repeater control). When you click on one of the items[/color][/color][/color]
in[color=blue][color=green]
> > the[color=darkred]
> > > > left frame, it targets the right frame and displays a form prefilled[/color]
> > with[color=darkred]
> > > > information for the item you clicked.
> > > >
> > > > The problem is the left frame's list just shows the names of the[/color][/color]
> items,[color=green][color=darkred]
> > > and
> > > > the name of the item is editable in the right frame. So if I change[/color][/color]
> the[color=green][color=darkred]
> > > > name of the item in the right frame and save, I need it to[/color][/color]
> automatically[color=green][color=darkred]
> > > > update item's name in the left frame. How can I accomplish this?
> > > >
> > > > Is there is a way to accomplish this through server side code?
> > > >
> > > > Right now we're doing a clunky javascript solution which works, but[/color][/color]
> I'm[color=green][color=darkred]
> > > > hoping there is a better way. Basically in the save event for the[/color][/color]
> right[color=green][color=darkred]
> > > > frame (in the code-behind page), after the item is saved, we[/color][/color][/color]
redirect[color=blue]
> to[color=green]
> > a[color=darkred]
> > > > page that says "Your information has been saved" (or something to[/color][/color][/color]
that[color=blue][color=green][color=darkred]
> > > > effect). On this page's body's onload event (in the <body> tag,[/color][/color][/color]
i.e.[color=blue][color=green][color=darkred]
> > > > client-side) we are targetting the left frame to refresh with[/color]
> > javascript.[color=darkred]
> > > > It works, but like I said it seems clunky.
> > > >
> > > > Is there anyway in the save event for the right frame (in the[/color]
> > code-behind[color=darkred]
> > > > page), to tell the left frame to refresh.
> > > >
> > > > Thanks in advance,
> > > > Dan
> > > >
> > > >
> > > > ---
> > > > Outgoing mail is certified Virus Free.
> > > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > > Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003
> > > >
> > > >
> > >
> > >[/color]
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003
> >
> >[/color]
>
>[/color]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.548 / Virus Database: 341 - Release Date: 12/5/2003


Jason S
Guest
 
Posts: n/a
#6: Nov 18 '05

re: Is it possible to access another Page in code-behind


Hmm, too bad you can't just save the id of the last leaf that was opened and
then call something like tree.navigateto(leafID) and let the control sort it
out.

Jason S.

"Dan" <dhartley@somewhere.com> wrote in message
news:e8pKqcevDHA.2372@TK2MSFTNGP09.phx.gbl...[color=blue]
> Thanks for the help.
>
> I ended up having the right frame post, save, set a couple session
> variables, and redirect to a page whose onload event submits the left[/color]
frame.[color=blue]
> The left frame then recursively loops through the treenodes until it finds
> the one that has been edited (comparing its id with that of 1 of the[/color]
session[color=blue]
> variables), and changes its text to the new text (from the other session
> variable). This way the tree keeps its state (remembering which branches
> were expanded) and the text of the node changes appropriately. Still wish
> there was a better way though.
>
> Thanks,
> Dan
>
>
> "Jason S" <someone@somewhere.com> wrote in message
> news:eyMBmZavDHA.1872@TK2MSFTNGP09.phx.gbl...[color=green]
> > Ah, see, you didn't represent the entire problem. If I were you I would
> > save the path in the viewstate so that if I had to refresh it I could[/color][/color]
come[color=blue][color=green]
> > back to that area for the user. A la MSDN library
> > (msdn.microsoft.com/library).
> >
> > As far as accessing the page across the frame from another page on the
> > server I really don't see that. It's an interesting question from the
> > perspective of the container page though. I don't know if you could[/color][/color]
make[color=blue][color=green]
> > the framesets runat=server or not but that may be a way.
> >
> > Regards,
> > Jason
> >
> > "Dan" <dhartley@somewhere.com> wrote in message
> > news:ey#DmO4uDHA.2136@TK2MSFTNGP10.phx.gbl...[color=darkred]
> > > Thanks for the response.
> > >
> > > The real reason for wanting a better solution is because our[/color][/color][/color]
application[color=blue][color=green]
> > is[color=darkred]
> > > actually a lot more complicated than I posted originally but the same
> > > principle applies. In our project, the list in the left frame is[/color][/color]
> actually[color=green]
> > a[color=darkred]
> > > treeview, and the goal is to update the treenode's text with the[/color]
> > appropriate[color=darkred]
> > > changes, while at the same time keeping the treeview's state by[/color]
> > remembering[color=darkred]
> > > what nodes are expanded.
> > >
> > > It's basically like the windows explorer and how it deals with files[/color][/color][/color]
and[color=blue][color=green][color=darkred]
> > > folders.
> > >
> > > If I simply refresh the left frame, the entire treeview must be[/color][/color][/color]
reloaded[color=blue][color=green][color=darkred]
> > > from scratch and no state is able to be kept (the user is forced to[/color][/color]
> drill[color=green][color=darkred]
> > > down to get to where they were before).
> > >
> > > I was hoping there was a way to simple reference the left frame's[/color][/color]
> treeview[color=green][color=darkred]
> > > and change it from the code-behind page of the right frame. There are[/color]
> > other[color=darkred]
> > > options that I've considered which require much more work, but I[/color][/color][/color]
thought[color=blue][color=green]
> > I'd[color=darkred]
> > > see if there was an easier way before I started coding with those.
> > >
> > > Thanks,
> > > Dan
> > >
> > >
> > > "Jason S" <someone@somewhere.com> wrote in message
> > > news:e0maEU3uDHA.2448@TK2MSFTNGP09.phx.gbl...
> > > > Dan,
> > > >
> > > > I'm not sure why this seams clunky... that is the way I woud do it.[/color][/color]
> No,[color=green][color=darkred]
> > > you
> > > > cannot control a user's window refresh from the server - although[/color][/color][/color]
you[color=blue][color=green][color=darkred]
> > > could
> > > > resend the entire frameset. Same result.
> > > >
> > > > Regards,
> > > > Jason S.
> > > >
> > > > "Dan" <dhartley@somewhere.com> wrote in message
> > > > news:#bsjK72uDHA.2148@TK2MSFTNGP12.phx.gbl...
> > > > > We have a simple site. It's a frameset with two frames a left and[/color][/color][/color]
a[color=blue][color=green][color=darkred]
> > > > right.
> > > > > The left frame is essentially a list of records from a database[/color][/color]
> (using[color=green]
> > a[color=darkred]
> > > > > server-side repeater control). When you click on one of the items[/color][/color]
> in[color=green][color=darkred]
> > > the
> > > > > left frame, it targets the right frame and displays a form[/color][/color][/color]
prefilled[color=blue][color=green][color=darkred]
> > > with
> > > > > information for the item you clicked.
> > > > >
> > > > > The problem is the left frame's list just shows the names of the[/color]
> > items,[color=darkred]
> > > > and
> > > > > the name of the item is editable in the right frame. So if I[/color][/color][/color]
change[color=blue][color=green]
> > the[color=darkred]
> > > > > name of the item in the right frame and save, I need it to[/color]
> > automatically[color=darkred]
> > > > > update item's name in the left frame. How can I accomplish this?
> > > > >
> > > > > Is there is a way to accomplish this through server side code?
> > > > >
> > > > > Right now we're doing a clunky javascript solution which works,[/color][/color][/color]
but[color=blue][color=green]
> > I'm[color=darkred]
> > > > > hoping there is a better way. Basically in the save event for the[/color]
> > right[color=darkred]
> > > > > frame (in the code-behind page), after the item is saved, we[/color][/color]
> redirect[color=green]
> > to[color=darkred]
> > > a
> > > > > page that says "Your information has been saved" (or something to[/color][/color]
> that[color=green][color=darkred]
> > > > > effect). On this page's body's onload event (in the <body> tag,[/color][/color]
> i.e.[color=green][color=darkred]
> > > > > client-side) we are targetting the left frame to refresh with
> > > javascript.
> > > > > It works, but like I said it seems clunky.
> > > > >
> > > > > Is there anyway in the save event for the right frame (in the
> > > code-behind
> > > > > page), to tell the left frame to refresh.
> > > > >
> > > > > Thanks in advance,
> > > > > Dan
> > > > >
> > > > >
> > > > > ---
> > > > > Outgoing mail is certified Virus Free.
> > > > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > > > Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > > ---
> > > Outgoing mail is certified Virus Free.
> > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003
> > >
> > >[/color]
> >
> >[/color]
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.548 / Virus Database: 341 - Release Date: 12/5/2003
>
>[/color]


Closed Thread