473,326 Members | 2,102 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,326 software developers and data experts.

PopUp Window from Codebehind

I want to popup a window from my codebehind. The reason is that during
the postback the code needs to do some validations and to build the
arguments that are passed in the url. How can I achieve this
functionality?
The reason I do not want to use Response.Redirect is because when the
user comes back to the first page, all the selections that were
made(which are the arguments) disappear.
Nov 18 '05 #1
9 3893
there is no way to do that directly from code-behind, it has to pass to a
clientside call

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Rathtap" <am****@yahoo.com> wrote in message
news:b2**************************@posting.google.c om...
I want to popup a window from my codebehind. The reason is that during
the postback the code needs to do some validations and to build the
arguments that are passed in the url. How can I achieve this
functionality?
The reason I do not want to use Response.Redirect is because when the
user comes back to the first page, all the selections that were
made(which are the arguments) disappear.

Nov 18 '05 #2
I saw Frank Gimberg do something similar to this in a demo once a year or
two ago. You can contact him at fr***@prosoft-sys.com
"Rathtap" <am****@yahoo.com> wrote in message
news:b2**************************@posting.google.c om...
I want to popup a window from my codebehind. The reason is that during
the postback the code needs to do some validations and to build the
arguments that are passed in the url. How can I achieve this
functionality?
The reason I do not want to use Response.Redirect is because when the
user comes back to the first page, all the selections that were
made(which are the arguments) disappear.

Nov 18 '05 #3
while you can emit javascript to do this, any popup blocker will stop it.

-- bruce (sqlwork.com)
"Rathtap" <am****@yahoo.com> wrote in message
news:b2**************************@posting.google.c om...
I want to popup a window from my codebehind. The reason is that during
the postback the code needs to do some validations and to build the
arguments that are passed in the url. How can I achieve this
functionality?
The reason I do not want to use Response.Redirect is because when the
user comes back to the first page, all the selections that were
made(which are the arguments) disappear.

Nov 18 '05 #4
You have a couple of options. One is to generate a JavaScript that opens the
new window. As has been pointed out, popup blockers will stop it. However,
another approach (also using JavaScript) is to programmatically click a
(hidden) hyperlink that opens in a new window, thus avoiding the popup
blockers. However, you wil have no control over the new window's size and
configuration.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Rathtap" <am****@yahoo.com> wrote in message
news:b2**************************@posting.google.c om...
I want to popup a window from my codebehind. The reason is that during
the postback the code needs to do some validations and to build the
arguments that are passed in the url. How can I achieve this
functionality?
The reason I do not want to use Response.Redirect is because when the
user comes back to the first page, all the selections that were
made(which are the arguments) disappear.

Nov 18 '05 #5
Forgive me. I spoke too quickly Upon reflection, I realized that JavaScript
can't click a hyperlink. Oh well. I can't think of any other way to open a
new browser window that won't be foiled by popup blockers. Best to try
another route.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"bruce barker" <no***********@safeco.com> wrote in message
news:ed**************@TK2MSFTNGP15.phx.gbl...
while you can emit javascript to do this, any popup blocker will stop it.

-- bruce (sqlwork.com)
"Rathtap" <am****@yahoo.com> wrote in message
news:b2**************************@posting.google.c om...
I want to popup a window from my codebehind. The reason is that during
the postback the code needs to do some validations and to build the
arguments that are passed in the url. How can I achieve this
functionality?
The reason I do not want to use Response.Redirect is because when the
user comes back to the first page, all the selections that were
made(which are the arguments) disappear.


Nov 18 '05 #6
Kevin,

This has been bother me for quite awhile.

Why does my code for a pop-up window from my app not get blocked by IE SP2
pop-up blocker or the Google toolbar? (Yet some other pop-up blockers that
my users have installed does block it)

(No exceptions have been made in IE's Pop-up blocker settings either)

Private Function openNewWindow(ByVal url As String, ByVal windowName As
String, ByVal features As String) As String

' url parameter must be enclosed in single quotes!!!

Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder
sb.Append("javascript:var " & windowName & " = window.open(" + url +
",'" + windowName + "','" & features + "');" & windowName & ".focus();")

Return sb.ToString()
End Function

The code is not really important here. I think I might be missing the big
picture; are pop-up allowed if they are user initiated. (i.e. a user click a
hyperlink that causes the pop-up)?

BTW, here is a great link I saw yesterday to encapsulate creating a pop-up
into a class:

http://www.dotnet2themax.com/ShowCon...9-6f952f31491a

Greg

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:Oe*************@TK2MSFTNGP11.phx.gbl...
Forgive me. I spoke too quickly Upon reflection, I realized that
JavaScript
can't click a hyperlink. Oh well. I can't think of any other way to open a
new browser window that won't be foiled by popup blockers. Best to try
another route.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"bruce barker" <no***********@safeco.com> wrote in message
news:ed**************@TK2MSFTNGP15.phx.gbl...
while you can emit javascript to do this, any popup blocker will stop it.

-- bruce (sqlwork.com)
"Rathtap" <am****@yahoo.com> wrote in message
news:b2**************************@posting.google.c om...
> I want to popup a window from my codebehind. The reason is that during
> the postback the code needs to do some validations and to build the
> arguments that are passed in the url. How can I achieve this
> functionality?
> The reason I do not want to use Response.Redirect is because when the
> user comes back to the first page, all the selections that were
> made(which are the arguments) disappear.



Nov 18 '05 #7
It's not a popup if the user clicked it, it's a link. Popups are usually
designated as loaded from within the page without the user instructing it to
do so.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:O7**************@TK2MSFTNGP15.phx.gbl...
Kevin,

This has been bother me for quite awhile.

Why does my code for a pop-up window from my app not get blocked by IE SP2
pop-up blocker or the Google toolbar? (Yet some other pop-up blockers
that my users have installed does block it)

(No exceptions have been made in IE's Pop-up blocker settings either)

Private Function openNewWindow(ByVal url As String, ByVal windowName As
String, ByVal features As String) As String

' url parameter must be enclosed in single quotes!!!

Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder
sb.Append("javascript:var " & windowName & " = window.open(" + url
+ ",'" + windowName + "','" & features + "');" & windowName & ".focus();")

Return sb.ToString()
End Function

The code is not really important here. I think I might be missing the big
picture; are pop-up allowed if they are user initiated. (i.e. a user click
a hyperlink that causes the pop-up)?

BTW, here is a great link I saw yesterday to encapsulate creating a pop-up
into a class:

http://www.dotnet2themax.com/ShowCon...9-6f952f31491a

Greg

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:Oe*************@TK2MSFTNGP11.phx.gbl...
Forgive me. I spoke too quickly Upon reflection, I realized that
JavaScript
can't click a hyperlink. Oh well. I can't think of any other way to open
a
new browser window that won't be foiled by popup blockers. Best to try
another route.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"bruce barker" <no***********@safeco.com> wrote in message
news:ed**************@TK2MSFTNGP15.phx.gbl...
while you can emit javascript to do this, any popup blocker will stop
it.

-- bruce (sqlwork.com)
"Rathtap" <am****@yahoo.com> wrote in message
news:b2**************************@posting.google.c om...
> I want to popup a window from my codebehind. The reason is that during
> the postback the code needs to do some validations and to build the
> arguments that are passed in the url. How can I achieve this
> functionality?
> The reason I do not want to use Response.Redirect is because when the
> user comes back to the first page, all the selections that were
> made(which are the arguments) disappear.



Nov 18 '05 #8
I don't think I expressed myself well.

For example, I have button (being a hyperlink button or push button) in a
datagrid. When the user selects it, is causes a postback. In the post back
code, I am building js window.open function that I append to the output of
the page with Page.RegisterStartupScript. (I am dynamically building the
querystring). How does/should a pop-up blocker treat this situation? My
pop-up blockers are allowing it, some or not.

Greg
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:uZ**************@TK2MSFTNGP15.phx.gbl...
It's not a popup if the user clicked it, it's a link. Popups are usually
designated as loaded from within the page without the user instructing it
to do so.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:O7**************@TK2MSFTNGP15.phx.gbl...
Kevin,

This has been bother me for quite awhile.

Why does my code for a pop-up window from my app not get blocked by IE
SP2 pop-up blocker or the Google toolbar? (Yet some other pop-up
blockers that my users have installed does block it)

(No exceptions have been made in IE's Pop-up blocker settings either)

Private Function openNewWindow(ByVal url As String, ByVal windowName
As String, ByVal features As String) As String

' url parameter must be enclosed in single quotes!!!

Dim sb As System.Text.StringBuilder = New
System.Text.StringBuilder
sb.Append("javascript:var " & windowName & " = window.open(" + url
+ ",'" + windowName + "','" & features + "');" & windowName &
".focus();")

Return sb.ToString()
End Function

The code is not really important here. I think I might be missing the
big picture; are pop-up allowed if they are user initiated. (i.e. a user
click a hyperlink that causes the pop-up)?

BTW, here is a great link I saw yesterday to encapsulate creating a
pop-up into a class:

http://www.dotnet2themax.com/ShowCon...9-6f952f31491a

Greg

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:Oe*************@TK2MSFTNGP11.phx.gbl...
Forgive me. I spoke too quickly Upon reflection, I realized that
JavaScript
can't click a hyperlink. Oh well. I can't think of any other way to open
a
new browser window that won't be foiled by popup blockers. Best to try
another route.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"bruce barker" <no***********@safeco.com> wrote in message
news:ed**************@TK2MSFTNGP15.phx.gbl...
while you can emit javascript to do this, any popup blocker will stop
it.

-- bruce (sqlwork.com)
"Rathtap" <am****@yahoo.com> wrote in message
news:b2**************************@posting.google.c om...
> I want to popup a window from my codebehind. The reason is that
> during
> the postback the code needs to do some validations and to build the
> arguments that are passed in the url. How can I achieve this
> functionality?
> The reason I do not want to use Response.Redirect is because when the
> user comes back to the first page, all the selections that were
> made(which are the arguments) disappear.



Nov 18 '05 #9
Hi Gregg,

Windows XP Service Pack 2 includes a Popup blocker. I can't tell you
anything about other popup blockers, but here is all the info about Windows
XP Service Pack 2 for developers:

http://msdn.microsoft.com/security/p...2/default.aspx

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:#i**************@TK2MSFTNGP15.phx.gbl...
I don't think I expressed myself well.

For example, I have button (being a hyperlink button or push button) in a
datagrid. When the user selects it, is causes a postback. In the post back code, I am building js window.open function that I append to the output of
the page with Page.RegisterStartupScript. (I am dynamically building the
querystring). How does/should a pop-up blocker treat this situation? My
pop-up blockers are allowing it, some or not.

Greg
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:uZ**************@TK2MSFTNGP15.phx.gbl...
It's not a popup if the user clicked it, it's a link. Popups are usually
designated as loaded from within the page without the user instructing it to do so.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:O7**************@TK2MSFTNGP15.phx.gbl...
Kevin,

This has been bother me for quite awhile.

Why does my code for a pop-up window from my app not get blocked by IE
SP2 pop-up blocker or the Google toolbar? (Yet some other pop-up
blockers that my users have installed does block it)

(No exceptions have been made in IE's Pop-up blocker settings either)

Private Function openNewWindow(ByVal url As String, ByVal windowName
As String, ByVal features As String) As String

' url parameter must be enclosed in single quotes!!!

Dim sb As System.Text.StringBuilder = New
System.Text.StringBuilder
sb.Append("javascript:var " & windowName & " = window.open(" + url + ",'" + windowName + "','" & features + "');" & windowName &
".focus();")

Return sb.ToString()
End Function

The code is not really important here. I think I might be missing the
big picture; are pop-up allowed if they are user initiated. (i.e. a user click a hyperlink that causes the pop-up)?

BTW, here is a great link I saw yesterday to encapsulate creating a
pop-up into a class:

http://www.dotnet2themax.com/ShowCon...9-6f952f31491a
Greg

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:Oe*************@TK2MSFTNGP11.phx.gbl...
Forgive me. I spoke too quickly Upon reflection, I realized that
JavaScript
can't click a hyperlink. Oh well. I can't think of any other way to open a
new browser window that won't be foiled by popup blockers. Best to try
another route.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"bruce barker" <no***********@safeco.com> wrote in message
news:ed**************@TK2MSFTNGP15.phx.gbl...
> while you can emit javascript to do this, any popup blocker will stop
> it.
>
> -- bruce (sqlwork.com)
>
>
> "Rathtap" <am****@yahoo.com> wrote in message
> news:b2**************************@posting.google.c om...
> > I want to popup a window from my codebehind. The reason is that
> > during
> > the postback the code needs to do some validations and to build the
> > arguments that are passed in the url. How can I achieve this
> > functionality?
> > The reason I do not want to use Response.Redirect is because when the> > user comes back to the first page, all the selections that were
> > made(which are the arguments) disappear.
>
>



Nov 18 '05 #10

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

Similar topics

1
by: Noozer | last post by:
When using the WebBrowser control, is it possible to cause popup windows to appear within the WebBrowser control itself instead of a new window? This is what I've written in the NewWindow2 event,...
17
by: Applebrownbetty | last post by:
Hi, I'd like to append/amend the following code from the Dreamweaver extension "Open Picture Window Fever" for the ability to center the PopUp window: By default, it allows the window to be...
7
by: E Michael Brandt | last post by:
I have been lurking here for some time, and now would like to ask a question of you clever coders: My JustSo PictureWindow 3 Extension for Dreamweaver has stumbled in the face of the new Opera...
4
by: Davey | last post by:
I have a website which has a popup window (this only opens when the user chooses to open it). In the popup window I have a <select> control which lists a selection of "classes". Each class has a...
4
by: GrantS | last post by:
I am having a problem closing a popup window opened modally. When I try to close the window (when the user hits save button and the data has been processed), the Popup window opens as a full screen...
2
by: Ingeborg | last post by:
Hi. Is it possible to create a popup window (or something similar) from codebehind? Like after pressing a button and if som conditions is true? Thanks in advance. Ingeborg
1
by: Paul Ross | last post by:
Is there a way to open a popup window with a specific location relative to the parent window. For example, centered on the parent window, or near a specific control on the parent window. It...
7
by: Drew Berkemeyer | last post by:
Hello, We have an application that we have written using ASP.NET. On one of our pages we open a popup window using javascript. The popup window has a save and a cancel button. Both of them are...
7
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses...
11
by: V S Rawat | last post by:
using Javascript, I am opening a web-based url in a popup window. MyWin1=Window.Open(url, "mywindow") There is a form (form1) in the url in that popup window, I need to submit that form. ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.