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

click button

In a web form, I want the user clicks on one button and this button will
trigger another button/link which will open a new browser window? How to do
that? Is there any method like
Button.performclick?

Thanks
Jul 21 '05 #1
4 4719
Opening another browser window is not something you can do from server-side
code. Only the client can control the client. You have 2 questions here so
let me answer them individually.

1. How to call the click event of a button from the click event of another
button: This is accomplished by simply placing a call to the click event
handler of the second button in the first:

Sub Button1_Click() Handles Button1.Click
'Call the click event handler of button2
Button2_Click()
End Sub

Sub Button2_Click() Handles Button2.Click
'Button2's click event code here
End Sub

2. How to open a new browser window. As stated, only client-side code
(JavaScript) can do this, so you either have to embed a client-side script
and add a client-side event handler to a button
(onClick="window.open('fileToOpen')) or send this code to the client-side
control from the server side:

Page_Load()
Button2.Attributes.Add("onClick","window.open('fil eToOpen')")
End Sub


"yfng" <yf**@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
In a web form, I want the user clicks on one button and this button will
trigger another button/link which will open a new browser window? How to
do
that? Is there any method like
Button.performclick?

Thanks

Jul 21 '05 #2
Thanks.
But the problem is that... I want to ensure that some server scripts will
run before another browser window opens... For the
button.attribute.add("onclick", "javascript:window.open")... It seems that it
cannot gurantee this ...

"Scott M." wrote:
Opening another browser window is not something you can do from server-side
code. Only the client can control the client. You have 2 questions here so
let me answer them individually.

1. How to call the click event of a button from the click event of another
button: This is accomplished by simply placing a call to the click event
handler of the second button in the first:

Sub Button1_Click() Handles Button1.Click
'Call the click event handler of button2
Button2_Click()
End Sub

Sub Button2_Click() Handles Button2.Click
'Button2's click event code here
End Sub

2. How to open a new browser window. As stated, only client-side code
(JavaScript) can do this, so you either have to embed a client-side script
and add a client-side event handler to a button
(onClick="window.open('fileToOpen')) or send this code to the client-side
control from the server side:

Page_Load()
Button2.Attributes.Add("onClick","window.open('fil eToOpen')")
End Sub


"yfng" <yf**@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
In a web form, I want the user clicks on one button and this button will
trigger another button/link which will open a new browser window? How to
do
that? Is there any method like
Button.performclick?

Thanks


Jul 21 '05 #3
How about having one .aspx page run your server code and when they are done,
simply use response.redirect or server.transfer to call another server page
that includes the button with the onClick event handler?
"yfng" <yf**@discussions.microsoft.com> wrote in message
news:E3**********************************@microsof t.com...
Thanks.
But the problem is that... I want to ensure that some server scripts will
run before another browser window opens... For the
button.attribute.add("onclick", "javascript:window.open")... It seems that
it
cannot gurantee this ...

"Scott M." wrote:
Opening another browser window is not something you can do from
server-side
code. Only the client can control the client. You have 2 questions here
so
let me answer them individually.

1. How to call the click event of a button from the click event of
another
button: This is accomplished by simply placing a call to the click event
handler of the second button in the first:

Sub Button1_Click() Handles Button1.Click
'Call the click event handler of button2
Button2_Click()
End Sub

Sub Button2_Click() Handles Button2.Click
'Button2's click event code here
End Sub

2. How to open a new browser window. As stated, only client-side code
(JavaScript) can do this, so you either have to embed a client-side
script
and add a client-side event handler to a button
(onClick="window.open('fileToOpen')) or send this code to the client-side
control from the server side:

Page_Load()
Button2.Attributes.Add("onClick","window.open('fil eToOpen')")
End Sub


"yfng" <yf**@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
> In a web form, I want the user clicks on one button and this button
> will
> trigger another button/link which will open a new browser window? How
> to
> do
> that? Is there any method like
> Button.performclick?
>
> Thanks


Jul 21 '05 #4
Thanks.

"Scott M." wrote:
How about having one .aspx page run your server code and when they are done,
simply use response.redirect or server.transfer to call another server page
that includes the button with the onClick event handler?
"yfng" <yf**@discussions.microsoft.com> wrote in message
news:E3**********************************@microsof t.com...
Thanks.
But the problem is that... I want to ensure that some server scripts will
run before another browser window opens... For the
button.attribute.add("onclick", "javascript:window.open")... It seems that
it
cannot gurantee this ...

"Scott M." wrote:
Opening another browser window is not something you can do from
server-side
code. Only the client can control the client. You have 2 questions here
so
let me answer them individually.

1. How to call the click event of a button from the click event of
another
button: This is accomplished by simply placing a call to the click event
handler of the second button in the first:

Sub Button1_Click() Handles Button1.Click
'Call the click event handler of button2
Button2_Click()
End Sub

Sub Button2_Click() Handles Button2.Click
'Button2's click event code here
End Sub

2. How to open a new browser window. As stated, only client-side code
(JavaScript) can do this, so you either have to embed a client-side
script
and add a client-side event handler to a button
(onClick="window.open('fileToOpen')) or send this code to the client-side
control from the server side:

Page_Load()
Button2.Attributes.Add("onClick","window.open('fil eToOpen')")
End Sub


"yfng" <yf**@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
> In a web form, I want the user clicks on one button and this button
> will
> trigger another button/link which will open a new browser window? How
> to
> do
> that? Is there any method like
> Button.performclick?
>
> Thanks


Jul 21 '05 #5

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

Similar topics

6
by: Sally | last post by:
I need to be able to click in a subform and run code but at the same time I need to be able to scroll the records without running the code. I tried coding the Enter event of the subform control but...
5
by: Steve | last post by:
Hi, Is it possible to make hitting the enter key in an ASP textbox run the code behind an ASP button on a form? I have a search page which users tend to type in the query then just hit enter...
11
by: CW | last post by:
I have message entry screen that's causing me a bit of an issue. At the moment, there are 2 buttons, one is used to send message to another user (btnSend) and another is used to send messages to...
3
by: Imran Aziz | last post by:
Hello All, I have a search text and button that post data and my button handler filters the repeater control. However when the button is clicked the first time. The page_load event is being called...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
0
by: Demetri | last post by:
I have created a web control that can be rendered as either a linkbutton or a button. It is a ConfirmButton control that allows a developer to force a user to confirm if they intended to click it...
21
by: Ben | last post by:
Hello I have frames set up in an asp.net application and need one frame to refresh another. Seeing as events need to be registered at the time the page is sent from the server, I was wondering...
6
by: user | last post by:
Hello, With ASP.NET2, how to program a button's click ? For example, I have two button and when i click the first one, i would like that the second one will be click too (by programming) ......
7
by: =?Utf-8?B?bWFydGluMQ==?= | last post by:
Hi, All, I create button in the code ( Dim Button as new Button), not using button web component (means not drap button and drop it ont he webform), after that I try to use button_click event,...
1
by: daonho | last post by:
I tried to use javascript to trigger up the button click function when user press enter key from the textbox. This function work fine with a single button click such has login page. However, if the...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.