473,724 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET Button and VB.NET Windows Form EXE

I am using the following command to launch and .NET VB Executable, which is
a simple Windows Form (printCheckClie nt.exe). I am using a HyperLink Control
and works perfect.
hlPrintChecks.N avigateUrl = "javascript :var newWindow
=window.open('p rintCheckClient .exe',
1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no')"

I want to use a standard ASP.NET Button, but not sure what method to use. Is
there a way to accomplish this. I may not need to use the javascript and
open in a new window, or is there a way to launch the .exe directly from the
button. The .exe is located on the web server.

TIA,

Steve Wofford
www.IntraRELY.com
Nov 18 '05 #1
7 2819
you can point to it but you can't have it lauch automatically. Best you will
get it either
1) prompt the user
2) run in the background on the server, but it's not interactive to the
client (ie: a service process on the server)

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"IntraRELY" <In*******@yaho o.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I am using the following command to launch and .NET VB Executable, which is a simple Windows Form (printCheckClie nt.exe). I am using a HyperLink Control and works perfect.
hlPrintChecks.N avigateUrl = "javascript :var newWindow
=window.open('p rintCheckClient .exe',
1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no')"

I want to use a standard ASP.NET Button, but not sure what method to use. Is there a way to accomplish this. I may not need to use the javascript and
open in a new window, or is there a way to launch the .exe directly from the button. The .exe is located on the web server.

TIA,

Steve Wofford
www.IntraRELY.com

Nov 18 '05 #2
Sorry, but I am not sure what you are saying. If I can point it to the exe
how would I do that.?

Steve

"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
you can point to it but you can't have it lauch automatically. Best you will get it either
1) prompt the user
2) run in the background on the server, but it's not interactive to the
client (ie: a service process on the server)

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"IntraRELY" <In*******@yaho o.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I am using the following command to launch and .NET VB Executable, which is
a simple Windows Form (printCheckClie nt.exe). I am using a HyperLink

Control
and works perfect.
hlPrintChecks.N avigateUrl = "javascript :var newWindow
=window.open('p rintCheckClient .exe',
1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no')"

I want to use a standard ASP.NET Button, but not sure what method to

use. Is
there a way to accomplish this. I may not need to use the javascript and
open in a new window, or is there a way to launch the .exe directly from

the
button. The .exe is located on the web server.

TIA,

Steve Wofford
www.IntraRELY.com


Nov 18 '05 #3
like this...
http://server/dir/file.exe

that's what I meant.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"IntraRELY" <In*******@yaho o.com> wrote in message
news:uD******** **********@TK2M SFTNGP11.phx.gb l...
Sorry, but I am not sure what you are saying. If I can point it to the exe how would I do that.?

Steve

"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
you can point to it but you can't have it lauch automatically. Best you

will
get it either
1) prompt the user
2) run in the background on the server, but it's not interactive to the
client (ie: a service process on the server)

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"IntraRELY" <In*******@yaho o.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I am using the following command to launch and .NET VB Executable, which
is
a simple Windows Form (printCheckClie nt.exe). I am using a HyperLink

Control
and works perfect.
hlPrintChecks.N avigateUrl = "javascript :var newWindow
=window.open('p rintCheckClient .exe',
1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no')"

I want to use a standard ASP.NET Button, but not sure what method to use.
Is
there a way to accomplish this. I may not need to use the javascript

and open in a new window, or is there a way to launch the .exe directly

from the
button. The .exe is located on the web server.

TIA,

Steve Wofford
www.IntraRELY.com



Nov 18 '05 #4
Hi Steve,

You asked if there is a more direct way to launch your EXE. Curt's reply is
your answer. I'd like to expand on that answer.

You currently use an <a> tag to run javascript code to open a new window.
You could instead set the <a> tag's HREF to the EXE itself. Then EXE will
run on the client machine with no additional window and no javascript.

Whenever you launch an EXE in a user's browser, the browser will first
prompt the user if they want to allow the program to run. This will apply
if you launch the program in the same window or if you use window.open to
open a new window.

When using window.open, you can specify attributes for the window. Your
sample specifies 'height=350,wid th=350,menubar= no,status=no,to olbar=no'.
When pointing an <a> tag's HREF directly to the EXE, you cannot specify
window attributes.

* Your current method:
<a href="javascrip t:var newWindow=windo w.open('printCh eckClient.exe',
1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no')">t est</a>

* Pointing the <a> tag directly to the EXE:
<a href="printChec kClient.exe">te st</a>

* You also asked about using a button:
<script language=javasc ript>
function Button1_Click() {
var newWindow=windo w.open('printCh eckClient.exe',
1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no');
}
</script>
<INPUT type=button id="Button1" name="Button1" onclick="Button 1_Click();"
value="test" />

---
Though the above button sample gets the job done, you asked about using an
ASP.NET button. This gets more complicated. I recommend using an HTML
button rather than an ASP.NET button.

First off, the ASP.NET button is really meant to submit the form. If you
add code to its onclick event, that will be executed and then the form will
be submitted. You can avoid the form submission by having your client
script function return false. For IE browsers, you can also add a line of
code to your onclick event which sets event.returnVal ue=false;.

Second, if your page also has ASP.NET validation controls, and the button
is set to cause validation, then it gets much more complex. The validation
controls override your onclick event with their own. You can view several
workarounds at http://authors.aspalliance.com/kenc/faq6.aspx.

---
You might also be interested in attributes.add. This allows you to use
server-side code to add the onclick attribute to the button. This applies
to ASP.NET buttons and to HTML buttons if they are set with runat="server".
See:

Code: Setting HTML Attributes for Controls in Web Forms Pages (Visual Basic)
http://msdn.microsoft.com/library/en...desettinghtmla
ttributesforcon trolsinwebforms pagesvisualbasi c.asp

You can also use server-side code to generate the script executed by the
onclick event. See:

Page.RegisterCl ientScriptBlock Method
http://msdn.microsoft.com/library/en...webuipageclass
registerclients criptblocktopic .asp

---
Does this answer your question?

Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer's security.

This posting is provided "AS IS", with no warranties, and confers no rights.

--------------------
From: "Curt_C [MVP]" <software_AT_da rkfalz.com>
References: <#9************ **@tk2msftngp13 .phx.gbl> <OX************ **@TK2MSFTNGP11 .phx.gbl>
<uD************ **@TK2MSFTNGP11 .phx.gbl> Subject: Re: ASP.NET Button and VB.NET Windows Form EXE
Date: Wed, 14 Jan 2004 14:37:55 -0600
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <es************ **@TK2MSFTNGP10 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: 208.252.151.83
Path: cpmsftngxa07.ph x.gbl!cpmsftngx a06.phx.gbl!TK2 MSFTNGXS01.phx. gbl!TK2MSFTNGXA 0
5.phx.gbl!TK2MS FTNGP08.phx.gbl !TK2MSFTNGP10.p hx.gbl Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:2022 28
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

like this...
http://server/dir/file.exe

that's what I meant.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"IntraRELY" <In*******@yaho o.com> wrote in message
news:uD******** **********@TK2M SFTNGP11.phx.gb l...
Sorry, but I am not sure what you are saying. If I can point it to the

exe
how would I do that.?

Steve

"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
you can point to it but you can't have it lauch automatically. Best you
will
get it either
1) prompt the user
2) run in the background on the server, but it's not interactive to
the client (ie: a service process on the server)

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"IntraRELY" <In*******@yaho o.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> I am using the following command to launch and .NET VB Executable,

which is
> a simple Windows Form (printCheckClie nt.exe). I am using a HyperLink
Control
> and works perfect.
> hlPrintChecks.N avigateUrl = "javascript :var newWindow
> =window.open('p rintCheckClient .exe',
> 1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no')"
>
> I want to use a standard ASP.NET Button, but not sure what method to

use.
Is
> there a way to accomplish this. I may not need to use the javascript and > open in a new window, or is there a way to launch the .exe directly from the
> button. The .exe is located on the web server.
>
> TIA,
>
> Steve Wofford
> www.IntraRELY.com
>
>




Nov 18 '05 #5
Hi Steve,

You asked if there is a more direct way to launch your EXE. Curt's reply is
your answer. I'd like to expand on that answer.

You currently use an <a> tag to run javascript code to open a new window.
You could instead set the <a> tag's HREF to the EXE itself. Then EXE will
run on the client machine with no additional window and no javascript.

Whenever you launch an EXE in a user's browser, the browser will first
prompt the user if they want to allow the program to run. This will apply
if you launch the program in the same window or if you use window.open to
open a new window.

When using window.open, you can specify attributes for the window. Your
sample specifies 'height=350,wid th=350,menubar= no,status=no,to olbar=no'.
When pointing an <a> tag's HREF directly to the EXE, you cannot specify
window attributes.

* Your current method:
<a href="javascrip t:var newWindow=windo w.open('printCh eckClient.exe',
1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no')">t est</a>

* Pointing the <a> tag directly to the EXE:
<a href="printChec kClient.exe">te st</a>

* You also asked about using a button:
<script language=javasc ript>
function Button1_Click() {
var newWindow=windo w.open('printCh eckClient.exe',
1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no');
}
</script>
<INPUT type=button id="Button1" name="Button1" onclick="Button 1_Click();"
value="test" />

---
Though the above button sample gets the job done, you asked about using an
ASP.NET button. This gets more complicated. I recommend using an HTML
button rather than an ASP.NET button.

First off, the ASP.NET button is really meant to submit the form. If you
add code to its onclick event, that will be executed and then the form will
be submitted. You can avoid the form submission by having your client
script function return false. For IE browsers, you can also add a line of
code to your onclick event which sets event.returnVal ue=false;.

Second, if your page also has ASP.NET validation controls, and the button
is set to cause validation, then it gets much more complex. The validation
controls override your onclick event with their own. You can view several
workarounds at http://authors.aspalliance.com/kenc/faq6.aspx.

---
You might also be interested in attributes.add. This allows you to use
server-side code to add the onclick attribute to the button. This applies
to ASP.NET buttons and to HTML buttons if they are set with runat="server".
See:

Code: Setting HTML Attributes for Controls in Web Forms Pages (Visual Basic)
http://msdn.microsoft.com/library/en...desettinghtmla
ttributesforcon trolsinwebforms pagesvisualbasi c.asp

You can also use server-side code to generate the script executed by the
onclick event. See:

Page.RegisterCl ientScriptBlock Method
http://msdn.microsoft.com/library/en...webuipageclass
registerclients criptblocktopic .asp

---
Does this answer your question?

Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer's security.

This posting is provided "AS IS", with no warranties, and confers no rights.

--------------------
From: "Curt_C [MVP]" <software_AT_da rkfalz.com>
References: <#9************ **@tk2msftngp13 .phx.gbl> <OX************ **@TK2MSFTNGP11 .phx.gbl>
<uD************ **@TK2MSFTNGP11 .phx.gbl> Subject: Re: ASP.NET Button and VB.NET Windows Form EXE
Date: Wed, 14 Jan 2004 14:37:55 -0600
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <es************ **@TK2MSFTNGP10 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: 208.252.151.83
Path: cpmsftngxa07.ph x.gbl!cpmsftngx a06.phx.gbl!TK2 MSFTNGXS01.phx. gbl!TK2MSFTNGXA 0
5.phx.gbl!TK2MS FTNGP08.phx.gbl !TK2MSFTNGP10.p hx.gbl Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:2022 28
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

like this...
http://server/dir/file.exe

that's what I meant.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"IntraRELY" <In*******@yaho o.com> wrote in message
news:uD******** **********@TK2M SFTNGP11.phx.gb l...
Sorry, but I am not sure what you are saying. If I can point it to the

exe
how would I do that.?

Steve

"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
you can point to it but you can't have it lauch automatically. Best you
will
get it either
1) prompt the user
2) run in the background on the server, but it's not interactive to
the client (ie: a service process on the server)

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"IntraRELY" <In*******@yaho o.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> I am using the following command to launch and .NET VB Executable,

which is
> a simple Windows Form (printCheckClie nt.exe). I am using a HyperLink
Control
> and works perfect.
> hlPrintChecks.N avigateUrl = "javascript :var newWindow
> =window.open('p rintCheckClient .exe',
> 1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no')"
>
> I want to use a standard ASP.NET Button, but not sure what method to

use.
Is
> there a way to accomplish this. I may not need to use the javascript and > open in a new window, or is there a way to launch the .exe directly from the
> button. The .exe is located on the web server.
>
> TIA,
>
> Steve Wofford
> www.IntraRELY.com
>
>




Nov 18 '05 #6
Mike,

Great Information...T hanks!

There are really 1 reason why I need an ASP.NET button and is becuase when
clicked the button removes records from a dataGrid and has to redraw the
grid with the correct paging. There is also updates sent to the database. I
looks pretty complicated to move away from the ASP.NET Button. There is no
validataion on the page so there is no problem there. It looks easy enough
to attach some javascript to the button and put it at the end of my routine.

Thanks again to all who posted, but Mike you went out of your way...THANKS.

Steve Wofford
www.IntraRELY.com

""Mike Moore [MSFT]"" <mi****@online. microsoft.com> wrote in message
news:Iw******** ******@cpmsftng xa07.phx.gbl...
Hi Steve,

You asked if there is a more direct way to launch your EXE. Curt's reply is your answer. I'd like to expand on that answer.

You currently use an <a> tag to run javascript code to open a new window.
You could instead set the <a> tag's HREF to the EXE itself. Then EXE will
run on the client machine with no additional window and no javascript.

Whenever you launch an EXE in a user's browser, the browser will first
prompt the user if they want to allow the program to run. This will apply
if you launch the program in the same window or if you use window.open to
open a new window.

When using window.open, you can specify attributes for the window. Your
sample specifies 'height=350,wid th=350,menubar= no,status=no,to olbar=no'.
When pointing an <a> tag's HREF directly to the EXE, you cannot specify
window attributes.

* Your current method:
<a href="javascrip t:var newWindow=windo w.open('printCh eckClient.exe',
1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no')">t est</a>

* Pointing the <a> tag directly to the EXE:
<a href="printChec kClient.exe">te st</a>

* You also asked about using a button:
<script language=javasc ript>
function Button1_Click() {
var newWindow=windo w.open('printCh eckClient.exe',
1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no');
}
</script>
<INPUT type=button id="Button1" name="Button1" onclick="Button 1_Click();"
value="test" />

---
Though the above button sample gets the job done, you asked about using an
ASP.NET button. This gets more complicated. I recommend using an HTML
button rather than an ASP.NET button.

First off, the ASP.NET button is really meant to submit the form. If you
add code to its onclick event, that will be executed and then the form will be submitted. You can avoid the form submission by having your client
script function return false. For IE browsers, you can also add a line of
code to your onclick event which sets event.returnVal ue=false;.

Second, if your page also has ASP.NET validation controls, and the button
is set to cause validation, then it gets much more complex. The validation
controls override your onclick event with their own. You can view several
workarounds at http://authors.aspalliance.com/kenc/faq6.aspx.

---
You might also be interested in attributes.add. This allows you to use
server-side code to add the onclick attribute to the button. This applies
to ASP.NET buttons and to HTML buttons if they are set with runat="server". See:

Code: Setting HTML Attributes for Controls in Web Forms Pages (Visual Basic) http://msdn.microsoft.com/library/en...desettinghtmla ttributesforcon trolsinwebforms pagesvisualbasi c.asp

You can also use server-side code to generate the script executed by the
onclick event. See:

Page.RegisterCl ientScriptBlock Method
http://msdn.microsoft.com/library/en...webuipageclass registerclients criptblocktopic .asp

---
Does this answer your question?

Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward steps listed to improve your computer's security.

This posting is provided "AS IS", with no warranties, and confers no rights.
--------------------
From: "Curt_C [MVP]" <software_AT_da rkfalz.com>
References: <#9************ **@tk2msftngp13 .phx.gbl> <OX************ **@TK2MSFTNGP11 .phx.gbl>
<uD************ **@TK2MSFTNGP11 .phx.gbl>
Subject: Re: ASP.NET Button and VB.NET Windows Form EXE
Date: Wed, 14 Jan 2004 14:37:55 -0600
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <es************ **@TK2MSFTNGP10 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: 208.252.151.83
Path:

cpmsftngxa07.ph x.gbl!cpmsftngx a06.phx.gbl!TK2 MSFTNGXS01.phx. gbl!TK2MSFTNGXA 0 5.phx.gbl!TK2MS FTNGP08.phx.gbl !TK2MSFTNGP10.p hx.gbl
Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:2022 28
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

like this...
http://server/dir/file.exe

that's what I meant.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"IntraRELY" <In*******@yaho o.com> wrote in message
news:uD******** **********@TK2M SFTNGP11.phx.gb l...
Sorry, but I am not sure what you are saying. If I can point it to the
exe
how would I do that.?

Steve

"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
> you can point to it but you can't have it lauch automatically. Best you will
> get it either
> 1) prompt the user
> 2) run in the background on the server, but it's not interactive to the > client (ie: a service process on the server)
>
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> www.Darkfalz.com
>
>
> "IntraRELY" <In*******@yaho o.com> wrote in message
> news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> > I am using the following command to launch and .NET VB Executable,

which
> is
> > a simple Windows Form (printCheckClie nt.exe). I am using a

HyperLink > Control
> > and works perfect.
> > hlPrintChecks.N avigateUrl = "javascript :var newWindow
> > =window.open('p rintCheckClient .exe',
> > 1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no')"
> >
> > I want to use a standard ASP.NET Button, but not sure what method to use.
> Is
> > there a way to accomplish this. I may not need to use the

javascript and
> > open in a new window, or is there a way to launch the .exe
directly from
> the
> > button. The .exe is located on the web server.
> >
> > TIA,
> >
> > Steve Wofford
> > www.IntraRELY.com
> >
> >
>
>


Nov 18 '05 #7
Mike,

Great Information...T hanks!

There are really 1 reason why I need an ASP.NET button and is becuase when
clicked the button removes records from a dataGrid and has to redraw the
grid with the correct paging. There is also updates sent to the database. I
looks pretty complicated to move away from the ASP.NET Button. There is no
validataion on the page so there is no problem there. It looks easy enough
to attach some javascript to the button and put it at the end of my routine.

Thanks again to all who posted, but Mike you went out of your way...THANKS.

Steve Wofford
www.IntraRELY.com

""Mike Moore [MSFT]"" <mi****@online. microsoft.com> wrote in message
news:Iw******** ******@cpmsftng xa07.phx.gbl...
Hi Steve,

You asked if there is a more direct way to launch your EXE. Curt's reply is your answer. I'd like to expand on that answer.

You currently use an <a> tag to run javascript code to open a new window.
You could instead set the <a> tag's HREF to the EXE itself. Then EXE will
run on the client machine with no additional window and no javascript.

Whenever you launch an EXE in a user's browser, the browser will first
prompt the user if they want to allow the program to run. This will apply
if you launch the program in the same window or if you use window.open to
open a new window.

When using window.open, you can specify attributes for the window. Your
sample specifies 'height=350,wid th=350,menubar= no,status=no,to olbar=no'.
When pointing an <a> tag's HREF directly to the EXE, you cannot specify
window attributes.

* Your current method:
<a href="javascrip t:var newWindow=windo w.open('printCh eckClient.exe',
1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no')">t est</a>

* Pointing the <a> tag directly to the EXE:
<a href="printChec kClient.exe">te st</a>

* You also asked about using a button:
<script language=javasc ript>
function Button1_Click() {
var newWindow=windo w.open('printCh eckClient.exe',
1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no');
}
</script>
<INPUT type=button id="Button1" name="Button1" onclick="Button 1_Click();"
value="test" />

---
Though the above button sample gets the job done, you asked about using an
ASP.NET button. This gets more complicated. I recommend using an HTML
button rather than an ASP.NET button.

First off, the ASP.NET button is really meant to submit the form. If you
add code to its onclick event, that will be executed and then the form will be submitted. You can avoid the form submission by having your client
script function return false. For IE browsers, you can also add a line of
code to your onclick event which sets event.returnVal ue=false;.

Second, if your page also has ASP.NET validation controls, and the button
is set to cause validation, then it gets much more complex. The validation
controls override your onclick event with their own. You can view several
workarounds at http://authors.aspalliance.com/kenc/faq6.aspx.

---
You might also be interested in attributes.add. This allows you to use
server-side code to add the onclick attribute to the button. This applies
to ASP.NET buttons and to HTML buttons if they are set with runat="server". See:

Code: Setting HTML Attributes for Controls in Web Forms Pages (Visual Basic) http://msdn.microsoft.com/library/en...desettinghtmla ttributesforcon trolsinwebforms pagesvisualbasi c.asp

You can also use server-side code to generate the script executed by the
onclick event. See:

Page.RegisterCl ientScriptBlock Method
http://msdn.microsoft.com/library/en...webuipageclass registerclients criptblocktopic .asp

---
Does this answer your question?

Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward steps listed to improve your computer's security.

This posting is provided "AS IS", with no warranties, and confers no rights.
--------------------
From: "Curt_C [MVP]" <software_AT_da rkfalz.com>
References: <#9************ **@tk2msftngp13 .phx.gbl> <OX************ **@TK2MSFTNGP11 .phx.gbl>
<uD************ **@TK2MSFTNGP11 .phx.gbl>
Subject: Re: ASP.NET Button and VB.NET Windows Form EXE
Date: Wed, 14 Jan 2004 14:37:55 -0600
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <es************ **@TK2MSFTNGP10 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: 208.252.151.83
Path:

cpmsftngxa07.ph x.gbl!cpmsftngx a06.phx.gbl!TK2 MSFTNGXS01.phx. gbl!TK2MSFTNGXA 0 5.phx.gbl!TK2MS FTNGP08.phx.gbl !TK2MSFTNGP10.p hx.gbl
Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:2022 28
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

like this...
http://server/dir/file.exe

that's what I meant.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"IntraRELY" <In*******@yaho o.com> wrote in message
news:uD******** **********@TK2M SFTNGP11.phx.gb l...
Sorry, but I am not sure what you are saying. If I can point it to the
exe
how would I do that.?

Steve

"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
> you can point to it but you can't have it lauch automatically. Best you will
> get it either
> 1) prompt the user
> 2) run in the background on the server, but it's not interactive to the > client (ie: a service process on the server)
>
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> www.Darkfalz.com
>
>
> "IntraRELY" <In*******@yaho o.com> wrote in message
> news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> > I am using the following command to launch and .NET VB Executable,

which
> is
> > a simple Windows Form (printCheckClie nt.exe). I am using a

HyperLink > Control
> > and works perfect.
> > hlPrintChecks.N avigateUrl = "javascript :var newWindow
> > =window.open('p rintCheckClient .exe',
> > 1,'height=350,w idth=350,menuba r=no,status=no, toolbar=no')"
> >
> > I want to use a standard ASP.NET Button, but not sure what method to use.
> Is
> > there a way to accomplish this. I may not need to use the

javascript and
> > open in a new window, or is there a way to launch the .exe
directly from
> the
> > button. The .exe is located on the web server.
> >
> > TIA,
> >
> > Steve Wofford
> > www.IntraRELY.com
> >
> >
>
>


Nov 18 '05 #8

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

Similar topics

5
73212
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
1
5938
by: Mullin Yu | last post by:
I want to create a C# GUI application that will start a new console application, e.g. console.exe when clicking a button. Then, if click a button, it will kill a specific console application. Am I right that I need to create a new thread when clicking a "Start Button" for starting a console application. And, a separating thread of "Stop Button" is used to stop a specific console application?? I tried to do the following, button the...
4
2627
by: Arif «imen | last post by:
Hi to everybody, I have chnged a button text in design mode. But After compiling and executing the program the text of the button do not change to new value. Any Ideas? Thaks for helps.
4
5588
by: Dmitry Korolyov [MVP] | last post by:
When we use btnSubmit.Attributes = "javascript: this.disabled=true;" to make the button disabled and prevent users from clicking it again while form data still posting, there is no longer postback. I.e. the button does go disabled, but the form does not invoke submit() method. Of course, it does work fine without this property. Clues?
18
2981
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead. If you do have any ideas I would really like to hear them. Thanks Colin - 0 - 0 - 0 - I want a glorified popup/context menu on a button that shows only when
3
2418
by: Neil Wallace | last post by:
Hi, This is an odd one. I've been struggling to get "double click" to work well for my controls. The same event handler works perfectly for buttons, but not for labels. Can anyone tell me why not? Below is an working VB.Net example to illustrate what I mean.
5
5431
by: Wonder | last post by:
How can I create or use the msgobx to show a message without a default button. The user has explicity to click on the button, so the msgbox closes it. Thanks,
14
4971
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons for things like delete, save, edit, cancel buttons - in the footer, or on the form detail section? 2. If in the footer, how do you add them to the tab order?
7
9079
by: Marcolino | last post by:
Hi all, I need to add a custom button to title bar on a form in addition of a standard button. (Minimize/Maximize, close etc.) I need also to handle OnClick event of this button. I looked around google but i'm not able to find any example that can help me. Many thanks in advance for your help. Marco
0
8741
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9389
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9243
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9160
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
5996
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4504
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3210
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 we have to send another system
2
2613
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2149
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.