Connecting Tech Pros Worldwide Help | Site Map

How to do server-side processing and then display pop-up with pop-up blocker enabled

domtam@hotmail.com
Guest
 
Posts: n/a
#1: Feb 3 '06
Hi all,

Here is what I want: when a user clicks a <asp:button>, its event
handler will do some server-side processing and then pop up a windows
of another page.

As far as I know, if no pop-up blocker is disabled, the button event
handler can be something like the following to pop-up a window after
server-side processing

// Do server-side processing first

// Then pop-up window
string strjscript = "<script language='javascript' id='PopUpScript'>";
strjscript += "window.open('popup.aspx', '_blank',
'height=300, width=200');";
strjscript += "</script" + ">";

if (!Page.IsClientScriptBlockRegistered("PopUpScript" ))
Page.RegisterClientScriptBlock("PopUpScript", strjscript);


However, google and yahoo toolbar pop-up blockers is able to block this
type of pop-up windows.

If there is no need to do server-side processing, I can do the
following in Page_Load

btnPopUp.Attributes.Add("OnClick", "window.open('popup.aspx',
'_blank', 'height=300, width=200');return false;");

Google toolbar popup-blocker won't block this type of pop-up, but
Yahoo toolbar will block it. So, if we need to get around yahoo toolbar
pop-up blocker, I think that we have to use an anchor (or
<asp:hyperlink> equivalently)

<asp:HyperLink ID="hyperlink1" NavigateUrl="PopUp.aspx" Runat="server"
Text="Click here"/>

hyperlink1.Attributes.Add("OnClick", "window.open('popup.aspx',
'_blank', 'height=300, width=200');return false;");

Unfortunately, the above methods cannot do any server-side processing
before popping-up the windows.

So, is there a method that can both do server-side processing and
bypass the pop-up blockers?

Thanks
Dominic

Bruce Barker
Guest
 
Posts: n/a
#2: Feb 3 '06

re: How to do server-side processing and then display pop-up with pop-up blocker enabled


yes.

1) you can use an AJAX technology to do the popup so the server is called
first.
2) do the server side process in the popup page (pass info thru the query
string - 2k limit)

-- bruce (sqlwork.com)


<domtam@hotmail.com> wrote in message
news:1139005193.415041.238750@g44g2000cwa.googlegr oups.com...[color=blue]
> Hi all,
>
> Here is what I want: when a user clicks a <asp:button>, its event
> handler will do some server-side processing and then pop up a windows
> of another page.
>
> As far as I know, if no pop-up blocker is disabled, the button event
> handler can be something like the following to pop-up a window after
> server-side processing
>
> // Do server-side processing first
>
> // Then pop-up window
> string strjscript = "<script language='javascript' id='PopUpScript'>";
> strjscript += "window.open('popup.aspx', '_blank',
> 'height=300, width=200');";
> strjscript += "</script" + ">";
>
> if (!Page.IsClientScriptBlockRegistered("PopUpScript" ))
> Page.RegisterClientScriptBlock("PopUpScript", strjscript);
>
>
> However, google and yahoo toolbar pop-up blockers is able to block this
> type of pop-up windows.
>
> If there is no need to do server-side processing, I can do the
> following in Page_Load
>
> btnPopUp.Attributes.Add("OnClick", "window.open('popup.aspx',
> '_blank', 'height=300, width=200');return false;");
>
> Google toolbar popup-blocker won't block this type of pop-up, but
> Yahoo toolbar will block it. So, if we need to get around yahoo toolbar
> pop-up blocker, I think that we have to use an anchor (or
> <asp:hyperlink> equivalently)
>
> <asp:HyperLink ID="hyperlink1" NavigateUrl="PopUp.aspx" Runat="server"
> Text="Click here"/>
>
> hyperlink1.Attributes.Add("OnClick", "window.open('popup.aspx',
> '_blank', 'height=300, width=200');return false;");
>
> Unfortunately, the above methods cannot do any server-side processing
> before popping-up the windows.
>
> So, is there a method that can both do server-side processing and
> bypass the pop-up blockers?
>
> Thanks
> Dominic
>[/color]


Randy Webb
Guest
 
Posts: n/a
#3: Feb 4 '06

re: How to do server-side processing and then display pop-up with pop-up blocker enabled


Bruce Barker said the following on 2/3/2006 6:03 PM:[color=blue]
> yes.
>
> 1) you can use an AJAX technology to do the popup so the server is called
> first.[/color]

And then ask why it still doesn't work?
[color=blue]
> 2) do the server side process in the popup page (pass info thru the query
> string - 2k limit)[/color]

Assuming you get a popup to start with....

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Otis Mukinfus
Guest
 
Posts: n/a
#4: Feb 4 '06

re: How to do server-side processing and then display pop-up with pop-up blocker enabled


On 3 Feb 2006 14:19:53 -0800, domtam@hotmail.com wrote:
In line...[color=blue]
>Hi all,
>
>Here is what I want: when a user clicks a <asp:button>, its event
>handler will do some server-side processing and then pop up a windows
>of another page.
>
>As far as I know, if no pop-up blocker is disabled, the button event
>handler can be something like the following to pop-up a window after
>server-side processing
>
>// Do server-side processing first
>
>// Then pop-up window
>string strjscript = "<script language='javascript' id='PopUpScript'>";
>strjscript += "window.open('popup.aspx', '_blank',
>'height=300, width=200');";
>strjscript += "</script" + ">";
>
>if (!Page.IsClientScriptBlockRegistered("PopUpScript" ))
> Page.RegisterClientScriptBlock("PopUpScript", strjscript);
>
>
>However, google and yahoo toolbar pop-up blockers is able to block this
>type of pop-up windows.[/color]

Excellent! Good for them!
[color=blue]
>
>If there is no need to do server-side processing, I can do the
>following in Page_Load
>
>btnPopUp.Attributes.Add("OnClick", "window.open('popup.aspx',
>'_blank', 'height=300, width=200');return false;");
>
>Google toolbar popup-blocker won't block this type of pop-up, but
>Yahoo toolbar will block it. So, if we need to get around yahoo toolbar
>pop-up blocker, I think that we have to use an anchor (or
><asp:hyperlink> equivalently)
>
><asp:HyperLink ID="hyperlink1" NavigateUrl="PopUp.aspx" Runat="server"
>Text="Click here"/>
>
>hyperlink1.Attributes.Add("OnClick", "window.open('popup.aspx',
>'_blank', 'height=300, width=200');return false;");
>
>Unfortunately, the above methods cannot do any server-side processing
>before popping-up the windows.
>
>So, is there a method that can both do server-side processing and
>bypass the pop-up blockers?
>
>Thanks
>Dominic[/color]

Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
Closed Thread