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

execute window.open without a button pressed?

I would like to return error message in a pop up window. Window.open
would be great, but it can only be associated to the onclick event of
the button: button.Attributes.Add("onclick",...

Any ideas?

I thought of creating a invisible button on the form, pressing it
programmatically, and hopefully this will fire the event above.
Any other ideas?

Thanks
Nov 18 '05 #1
4 2258
In Javascript you can use this script :

<script language="javascript">
window.open('error.aspx', 'error', '....');
</script>

whene browser parse this script popup is opened!

if you want to generate this script from server code for make it dinamically
you must use Page.RegisterClientScriptBlock method.

Brun

"cgia" <cg*****@katamail.com> wrote in message
news:b3**************************@posting.google.c om...
I would like to return error message in a pop up window. Window.open
would be great, but it can only be associated to the onclick event of
the button: button.Attributes.Add("onclick",...

Any ideas?

I thought of creating a invisible button on the form, pressing it
programmatically, and hopefully this will fire the event above.
Any other ideas?

Thanks

Nov 18 '05 #2
In Javascript you can use this script :

<script language="javascript">
window.open('error.aspx', 'error', '....');
</script>

whene browser parse this script popup is opened!

if you want to generate this script from server code for make it dinamically
you must use Page.RegisterClientScriptBlock method.

Brun

"cgia" <cg*****@katamail.com> wrote in message
news:b3**************************@posting.google.c om...
I would like to return error message in a pop up window. Window.open
would be great, but it can only be associated to the onclick event of
the button: button.Attributes.Add("onclick",...

Any ideas?

I thought of creating a invisible button on the form, pressing it
programmatically, and hopefully this will fire the event above.
Any other ideas?

Thanks

Nov 18 '05 #3
No you don't need to associate it with the onclick event of a button.
You can use the RegisterStartupScript instead to run the script as soon as
the HTML is rendered to the browser after postback.
Here's more info:
http://msdn.microsoft.com/library/de...criptTopic.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"cgia" <cg*****@katamail.com> wrote in message
news:b3**************************@posting.google.c om...
I would like to return error message in a pop up window. Window.open
would be great, but it can only be associated to the onclick event of
the button: button.Attributes.Add("onclick",...

Any ideas?

I thought of creating a invisible button on the form, pressing it
programmatically, and hopefully this will fire the event above.
Any other ideas?

Thanks

Nov 18 '05 #4
No you don't need to associate it with the onclick event of a button.
You can use the RegisterStartupScript instead to run the script as soon as
the HTML is rendered to the browser after postback.
Here's more info:
http://msdn.microsoft.com/library/de...criptTopic.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"cgia" <cg*****@katamail.com> wrote in message
news:b3**************************@posting.google.c om...
I would like to return error message in a pop up window. Window.open
would be great, but it can only be associated to the onclick event of
the button: button.Attributes.Add("onclick",...

Any ideas?

I thought of creating a invisible button on the form, pressing it
programmatically, and hopefully this will fire the event above.
Any other ideas?

Thanks

Nov 18 '05 #5

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

Similar topics

3
by: Steve | last post by:
Hi, I have a nice little script that works well displaying images on my website. It's a script where if you clik a thumbnail image a pop up window opens that contains a larger version of the same...
6
by: Jon | last post by:
Hello, I have a datagrid and the data in it is dynamically created at runtime... For iCounter = 0 To dataset.Tables(0).Columns.Count - 1 Dim objbc As New BoundColumn() With objbc .DataField...
8
by: David W. Simmonds | last post by:
Is there an easy way to create a new browser window from C# and ASP.NET? I would just like to have a popup window without any menus or toolbars that would contain a high-res image. The low-res...
6
by: Shamin | last post by:
Hi, Thanks in advance for answering to my Question. I'm stuck with this problem and would really appreciate any help. I have 2 aspx files (Main.aspx and ReportViewer.aspx). Main.aspx has a...
2
by: cgia | last post by:
I would like to return error message in a pop up window. Window.open would be great, but it can only be associated to the onclick event of the button: button.Attributes.Add("onclick",... Any...
5
by: Steve | last post by:
Hi, I currently have a problem passing a variable value from one page to another. Once a form submit button is pressed java pops up a window and displays some information. The problem being is...
2
by: Shelly | last post by:
I have a form that updates and stays in the same window. That is the desired behavior. On this form I also have two buttons. I want those buttons to open up a new window with information taken...
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. ...
1
by: dittu | last post by:
How to close the popup window when submitting the form? I have a sample.jsp. In that page one button is there. when button pressed, open popup window contains one "text box" and one " submit...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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...
0
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...

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.