473,503 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2265
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
5163
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
3850
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
1841
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
2693
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
298
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
2405
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
2780
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
5264
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
3192
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
7199
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
7323
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
6984
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
5576
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,...
1
5005
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...
0
4670
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...
0
3162
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...
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.