473,378 Members | 1,319 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Javascript in ASP.NET - Pop another window

I've got a web form with a number of dropdowns, combos, etc.
When the user submits the form, I want to redirect them to another form, but
I need to pop it in another window. So, I have a hyperlink on the form
whose NavigateURL gets refreshed whenever the user makes a selection
(...NavigateUrl = '<%#DataBinder.Eval(Container, "GetRedirect()") %>'...) -
but it's too slow to do all those round-trips!

I understand that in the code-behind form, I can Response.Redirect(), but I
can't do it in a new window (like if you set the <asp:hyperlink
Target="_blank">).

So, could someone show me how I could link a button to some Javascript that
would call code-behind code to get the response string, and run that code in
a new window?

Thanks!

as****@hotmail.com

Nov 17 '05 #1
3 8624
Nevyn,

In the code-behind, you could add client side javascript like so:

' This is assuming your button name is btnSubmit

btnSubmit.Attributes.Add("onclick", "window.open(blahblah.aspx);")

HTH,

Jeff Cheung

Nevyn Twyll wrote:
I've got a web form with a number of dropdowns, combos, etc.
When the user submits the form, I want to redirect them to another form, but
I need to pop it in another window. So, I have a hyperlink on the form
whose NavigateURL gets refreshed whenever the user makes a selection
(...NavigateUrl = '<%#DataBinder.Eval(Container, "GetRedirect()") %>'...) -
but it's too slow to do all those round-trips!

I understand that in the code-behind form, I can Response.Redirect(), but I
can't do it in a new window (like if you set the <asp:hyperlink
Target="_blank">).

So, could someone show me how I could link a button to some Javascript that
would call code-behind code to get the response string, and run that code in
a new window?

Thanks!

as****@hotmail.com



Nov 17 '05 #2
So, I feel a little dumb, but since the Reponse string (blahblah.aspx) is
dynamically calculated from the selected contents of the form, how do I get
this info in there so that when the user presses the button, that info is
calculated correctly?

Do I put a javascript method in the html? How do I then reference all the
controls / etc. in my code-behind?

is there any way the javascript below (where do I put that again) can call a
code-behind method?

"Cheung, Jeffrey Jing-Yen" <ji*****@emailREMOVEMEuser.net> wrote in message
news:ep**************@TK2MSFTNGP09.phx.gbl...
Nevyn,

In the code-behind, you could add client side javascript like so:

' This is assuming your button name is btnSubmit

btnSubmit.Attributes.Add("onclick", "window.open(blahblah.aspx);")

HTH,

Jeff Cheung

Nevyn Twyll wrote:
I've got a web form with a number of dropdowns, combos, etc.
When the user submits the form, I want to redirect them to another form, but I need to pop it in another window. So, I have a hyperlink on the form
whose NavigateURL gets refreshed whenever the user makes a selection
(...NavigateUrl = '<%#DataBinder.Eval(Container, "GetRedirect()") %>'...) - but it's too slow to do all those round-trips!

I understand that in the code-behind form, I can Response.Redirect(), but I can't do it in a new window (like if you set the <asp:hyperlink
Target="_blank">).

So, could someone show me how I could link a button to some Javascript that would call code-behind code to get the response string, and run that code in a new window?

Thanks!

as****@hotmail.com


Nov 17 '05 #3
Check out this article,
http://www.microsoft.com/india/msdn/...ndarinASP.aspx

--
Saravana
Microsoft India Community Star,MC**
www.ExtremeExperts.com

"Nevyn Twyll" <as****@hotmail.com> wrote in message
news:#O*************@TK2MSFTNGP11.phx.gbl...
So, I feel a little dumb, but since the Reponse string (blahblah.aspx) is
dynamically calculated from the selected contents of the form, how do I get this info in there so that when the user presses the button, that info is
calculated correctly?

Do I put a javascript method in the html? How do I then reference all the
controls / etc. in my code-behind?

is there any way the javascript below (where do I put that again) can call a code-behind method?

"Cheung, Jeffrey Jing-Yen" <ji*****@emailREMOVEMEuser.net> wrote in message news:ep**************@TK2MSFTNGP09.phx.gbl...
Nevyn,

In the code-behind, you could add client side javascript like so:

' This is assuming your button name is btnSubmit

btnSubmit.Attributes.Add("onclick", "window.open(blahblah.aspx);")

HTH,

Jeff Cheung

Nevyn Twyll wrote:
I've got a web form with a number of dropdowns, combos, etc.
When the user submits the form, I want to redirect them to another form,
but
I need to pop it in another window. So, I have a hyperlink on the
form whose NavigateURL gets refreshed whenever the user makes a selection
(...NavigateUrl = '<%#DataBinder.Eval(Container, "GetRedirect()")

%>'...) - but it's too slow to do all those round-trips!

I understand that in the code-behind form, I can Response.Redirect(), but I can't do it in a new window (like if you set the <asp:hyperlink
Target="_blank">).

So, could someone show me how I could link a button to some Javascript that would call code-behind code to get the response string, and run that code in a new window?

Thanks!

as****@hotmail.com



Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.