473,587 Members | 2,316 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

a question regarding .NET postbacks and javascript

Hi,

Here's my situation:

I have an asp.net webform and it has a linkbutton on it. The
linkbutton causes a postback. So the user selects some values and then
clicks the linkbutton. Now, based on the values the user selected, a
pop up window will get displayed when they click the linkbutton.

So in the event handler for the linkbutton postback I do the following.

//Get the users selected values and show the appropriate popup
private void lnkPopup_Click( object sender, System.EventArg s e)
{
Response.Write( "<SCRIPT language='javas cript'> " +
"window.open(ur l,'previewWnd', "
+ "'Height=450;Wi dth=600;toolbar =no;menubar=no; scrollbars=yes; status=no;resiz able=yes;');"
+ " </SCRIPT>");
}

So all it does is in the event is figure out the url variable based on
user selections and then show the popup using Response.Write

This works great in IE, but it does not work in Netscape 7 or Mozzilla
- it wwill not show the popup window in these browsers.
Any ideas why?

TIA

Nov 19 '05 #1
2 1042
Works fine. If you type javascript: into the address box, do you see any
errors?

Where is the javascript variable "url" being set? why is this a client-side
variable as opposed to a server side? My guess is that there's some
confusion here on your part...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"pj121" <pe**@blabberbl og.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
Hi,

Here's my situation:

I have an asp.net webform and it has a linkbutton on it. The
linkbutton causes a postback. So the user selects some values and then
clicks the linkbutton. Now, based on the values the user selected, a
pop up window will get displayed when they click the linkbutton.

So in the event handler for the linkbutton postback I do the following.

//Get the users selected values and show the appropriate popup
private void lnkPopup_Click( object sender, System.EventArg s e)
{
Response.Write( "<SCRIPT language='javas cript'> " +
"window.open(ur l,'previewWnd', "
+ "'Height=450;Wi dth=600;toolbar =no;menubar=no; scrollbars=yes; status=no;resiz a
ble=yes;');" + " </SCRIPT>");
}

So all it does is in the event is figure out the url variable based on
user selections and then show the popup using Response.Write

This works great in IE, but it does not work in Netscape 7 or Mozzilla
- it wwill not show the popup window in these browsers.
Any ideas why?

TIA

Nov 19 '05 #2
I need to make a pop up window when the postback event get finished.
This code works in ie but now in Netscape or Mozzilla

Do you know of another way to make a pop up window after the vent
handler gets processed?

Thanks

Karl Seguin wrote:
Works fine. If you type javascript: into the address box, do you see any errors?

Where is the javascript variable "url" being set? why is this a client-side variable as opposed to a server side? My guess is that there's some
confusion here on your part...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"pj121" <pe**@blabberbl og.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
Hi,

Here's my situation:

I have an asp.net webform and it has a linkbutton on it. The
linkbutton causes a postback. So the user selects some values and then clicks the linkbutton. Now, based on the values the user selected, a pop up window will get displayed when they click the linkbutton.

So in the event handler for the linkbutton postback I do the following.
//Get the users selected values and show the appropriate popup
private void lnkPopup_Click( object sender, System.EventArg s e)
{
Response.Write( "<SCRIPT language='javas cript'> " +
"window.open(ur l,'previewWnd', "
+

"'Height=450;Wi dth=600;toolbar =no;menubar=no; scrollbars=yes; status=no;resiz a ble=yes;');"
+ " </SCRIPT>");
}

So all it does is in the event is figure out the url variable based on user selections and then show the popup using Response.Write

This works great in IE, but it does not work in Netscape 7 or Mozzilla - it wwill not show the popup window in these browsers.
Any ideas why?

TIA


Nov 19 '05 #3

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

Similar topics

3
3322
by: John | last post by:
I have an asp.net control which on the first Load of the page has a unique ID something like: _ctl0__ctl1_GroupName__ctl1_ControlName and after the first postback it changes to: _ctl0__ctl1_GroupName__ctl0_ControlName which is very bad, because I'm using javascript which relies on the
1
4944
by: Frankie | last post by:
Just doing some testing here to see what happens when JavaScript is disabled. I was told somewhere along the line that PostBacks would fail because they rely on JavaScript: function __doPostBack(eventTarget, eventArgument) {... But my page is still posting back just fine with JavaScript disabled (while other JavaScript-dependent features...
1
3207
by: satish.vell | last post by:
Hi, I have a ASP.NET page inside which I toggle the display of a field using javascript. How can I save this display value between postbacks. Here is my code: <pre>
4
5628
Frinavale
by: Frinavale | last post by:
So a while ago I created a Tab Strip Control (before the AjaxToolkit had theirs otherwise I would have probably just used theirs). When I looked at the AjaxToolkit control to see how they got around this problem I discovered that they're using Animations. I don't want to bloat my control with the Ajaxtoolkit's Animation stuff though. I guess...
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8205
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.