I need to do my things from my code-behind (C#)..this is just the way I wetn from the beginning and cannot really go back.
If I call Response.Redirect("http://www.google.com"), It will open google in the same page.
If I call the above from a page contained in an iFrame, it will open google in that iFrame.
How can i specify a link (from my C# code behind now) that will open a complete new window with the specified page.
I've seen in asp, you do this using window.open(blah blah blah), but the thing is i got event handlers and all that in my form's code behind, that should take care of redirecting the user.
thanksPage.RegisterStartupScript("<script language=Javascript>window.open('http://www.mendhak.com/');</script>");
Thanks M,
Actually I kind of did figure that one out, but thought there should be a simple way in asp.net to do this.
I just can't believe there's no simple method, or even response.redirect overload that let you open new windows.
It's just a matter of understanding the difference between client side and server side. Response.Redirect sends a header message to the client browser, sending it the contents of the new page.
But opening a new window is something that happens on the client side, it's a browser-specific feature, which is why client side scripting is the only way. Hence, the javascript.
Thanks M,
As you can see I'm still learning on the fly. This site will go "live" this week, and when I started I knew ZIT about web dev. Without your (and some other guys here) I would not have been able to do this.
Did it the wrong way round, but was forced. Will study all this things *AFTER* I put got this site up and running...ridiculous huh?
by the way..just reinstalled this machine.
now, when i open a post of Mendhak, i get a login box telling me to enter a username and password to log on to www.microsoft.com.
Of course i click cancel, but then the page load, but showing red arrows (image not found right) where you got that MCP logo's in your signature?
It must have something to do with security zone settings for microsoft.com on your machine. You behind a proxy server?
If the problem continues, I'll remove those images. :sick:
Unless you're on Safari right now, in which case I don't care. :p
naah..leave it...it's sth new. does not bother me anyhow, and will look into it when i got time.
Safari is something I do when I go back to Africa...lol
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment