[.net] .NET/C#/webforms: updating two frames simultaneously ?
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 ?
Maybe with javascript?<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.
Check out the examples on the excellent w3schools site:
Scroll down to Frame, Frameset, and IFrame Objects
Cheers
Scroll down to Frame, Frameset, and IFrame Objects
Cheers
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:<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-->
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 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... :-(
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... :-(
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement