473,425 Members | 1,776 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,425 software developers and data experts.

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.EventArgs e)
{
Response.Write("<SCRIPT language='javascript'> " +
"window.open(url,'previewWnd',"
+ "'Height=450;Width=600;toolbar=no;menubar=no;scrol lbars=yes;status=no;resizable=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 1036
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**@blabberblog.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.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.EventArgs e)
{
Response.Write("<SCRIPT language='javascript'> " +
"window.open(url,'previewWnd',"
+ "'Height=450;Width=600;toolbar=no;menubar=no;scrol lbars=yes;status=no;resiza
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**@blabberblog.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.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.EventArgs e)
{
Response.Write("<SCRIPT language='javascript'> " +
"window.open(url,'previewWnd',"
+

"'Height=450;Width=600;toolbar=no;menubar=no;scrol lbars=yes;status=no;resiza 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
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: ...
1
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...
1
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
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...
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...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.