# [.net] .NET/C#/webforms: updating two frames simultaneously ?

## Recommended Posts

Alex Baker    172
Hello, i'm facing a problem, which shouldn't be one, usually (erm...at least, with such modern tool like C#/.net; i think?): i have a standard frameset for my application; on the left side is the navigation, in the mainframe the content; when the user clicks on a button (no link button!) i need to update both frames, navigation and mainframe, with another .ASPX-page. I have seen the "Response.Redirect()" function, but this function redirects only the current frame (i have tried to get on by using "Response.RedirectLocation", but it seems it has no effect?) Is there any chance of achieving this effect ?

##### Share on other sites
Nypyren    12063
Maybe with javascript?

Don't you just love how infuriating it is to go from programming regular Win32 apps with control over everything to programming web pages? Makes you want to eat broken glass.

##### Share on other sites
DaWanderer    538
you'll probably need some javascript to do that. In your ASP.NET Page_Load, you can assign javascript to a button with the Attributes property:
Button1.Attrubtes["onclick"] = "otherFrame.href='http://www.google.com'";

##### Share on other sites
Alex Baker    172

DaWanderer,

thank you yer much - this is exactly what i'm looking for !

##### Share on other sites
Guest Anonymous Poster
Response.RedirectLocation ="Target=_top";

##### Share on other sites
Alex Baker    172
hi;

having suspended this project for the last few month, today i tried out the informations:

call me dump or whatever, but i can't get it working:

MyButton.Attributes["onclick"] = "MainFrame.href='http://www.google.com'";

MyButton is a type of WebControls.Hyperlink; the above line of code is placed in Page_Load(). (the name of the frame is correct)

when changing the type of MyButton to WebControls.LinkButton, it has also no effect. additionally, i changed the type of MyButton to WebControls.Button; but it's not working, too.

the hint brought in by AnonymousPoster has also no effect.

regardless, what i do - it's just updating the frame where the button is placed in.

writing all this web application stuff is really frustrating... :-(