Skip to main content
GameDev.net gamedev.net
🔒 Locked

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

Started by Alex Baker Aug 3, 2005 at 3:04 AM 5 replies 3.3k views
Original Post
Alex Baker
Alex Baker
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 ?
Alex Baker Computer science is dealing with computers as much as astronomy is dealing with telescopes.
Nypyren
Nypyren
Maybe with &#106avascript?<br><br>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.
DaWanderer
DaWanderer
you'll probably need some &#106avascript to do that. In your ASP.NET Page_Load, you can assign &#106avascript to a button with the Attributes property:<br><!--STARTSCRIPT--><!--source lang="c#"--><div class="source"><pre><br>Button<span class="cpp-literal"><span class="cpp-number">1</span>.</span>Attrubtes[<span class="cpp-literal">"onclick"</span>] = <span class="cpp-literal">"otherFrame.href='http://www.google.com'"</span>;<br><br><br></pre></div><!--ENDSCRIPT-->
Alex Baker
Alex Baker

DaWanderer,

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


Alex Baker Computer science is dealing with computers as much as astronomy is dealing with telescopes.
Alex Baker
Alex Baker
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... :-(
Alex Baker Computer science is dealing with computers as much as astronomy is dealing with telescopes.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.