HtmlControls.HtmlInputFile and WebControls.Button click event

B

bcumminsr

Hi, I have a input="type" control and two WebControls.Buttons that do
not respond to click events if I type into the file input box a network
path and file. I have a break set on the click event and it doesn't
even enter the code. If I use the browse button on the input file
control to select the file then the click events work.

What I am trying to accomplish is have the user select a file on the
network and then just take the value (path and filename) to save in the
database so the file being attached to a work order can be found on the
network... therfore, I do not need to upload the file to the server,
just get the value of path and file.

Anyone have any idea what the problem may be? If not, another way to
achieve this task. Thanks in advance.
 
G

Gorgo

Hello

Can you provide HTML content of your page ?

If you just want to get path to some particular file without "Browse"
button you should put on your form simple "<asp:textbox>" control and
one <Asp:button> control. If you drag them using the designer then both
of them should be avaiable for you on server site.

please put your code and we'll se what can we do about that
regards
Gorgo

(e-mail address removed) napisal(a):
 
B

bcumminsr

Gorgo said:
Hello

Can you provide HTML content of your page ?

If you just want to get path to some particular file without "Browse"
button you should put on your form simple "<asp:textbox>" control and
one <Asp:button> control. If you drag them using the designer then both
of them should be avaiable for you on server site.

please put your code and we'll se what can we do about that
regards
Gorgo

(e-mail address removed) napisal(a):


Thanks Gorgo... I need both the browse button to select a file and
also allow the user to input the path and file in manually. With that
said below is the applicable lines of code.

<form id="Form1" method="post" encType="multipart/form-data"
runat="server">
..
..
<INPUT id="txtFile" style="WIDTH: 392px; HEIGHT: 22px" type="file"
size="46" name="txtFile" runat="server">
..
..
<asp:Button id="btnAttach" runat="server" Width="56px"
Text="Attach"></asp:Button>
 
B

bcumminsr

Thanks Gorgo... I need both the browse button to select a file and
also allow the user to input the path and file in manually. With that
said below is the applicable lines of code.

<form id="Form1" method="post" encType="multipart/form-data"
runat="server">
.
.
<INPUT id="txtFile" style="WIDTH: 392px; HEIGHT: 22px" type="file"
size="46" name="txtFile" runat="server">
.
.
<asp:Button id="btnAttach" runat="server" Width="56px"
Text="Attach"></asp:Button>


I found the solution on another link... here is the answer to do this
quickly:

<INPUT language="javascript" id="txtFile" type="file"
onchange="txtSendFile.value=this.value;">

<input TYPE="hidden" id="txtSendFile" runat="server">

The concept is the runat property is removed on the "type=file" control
to prevent the file from being uploaded.
 
B

bcumminsr

Thanks Gorgo... I need both the browse button to select a file and
also allow the user to input the path and file in manually. With that
said below is the applicable lines of code.

<form id="Form1" method="post" encType="multipart/form-data"
runat="server">
.
.
<INPUT id="txtFile" style="WIDTH: 392px; HEIGHT: 22px" type="file"
size="46" name="txtFile" runat="server">
.
.
<asp:Button id="btnAttach" runat="server" Width="56px"
Text="Attach"></asp:Button>


I found the solution on another link... here is the answer to do this
quickly:

<INPUT language="javascript" id="txtFile" type="file"
onchange="txtSendFile.value=this.value;">

<input TYPE="hidden" id="txtSendFile" runat="server">

The concept is the runat property is removed on the "type=file" control
to prevent the file from being uploaded.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top