473,657 Members | 2,556 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HtmlControls.Ht mlInputFile and WebControls.But ton click event

Hi, I have a input="type" control and two WebControls.But tons 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.

Aug 1 '06 #1
4 1931
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:textb ox>" control and
one <Asp:buttoncont rol. 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

bc*******@yahoo .com napisal(a):
Hi, I have a input="type" control and two WebControls.But tons 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.
Aug 1 '06 #2

Gorgo wrote:
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:textb ox>" control and
one <Asp:buttoncont rol. 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

bc*******@yahoo .com napisal(a):
Hi, I have a input="type" control and two WebControls.But tons 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.

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="multip art/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>

Aug 1 '06 #3

bc*******@yahoo .com wrote:
Gorgo wrote:
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:textb ox>" control and
one <Asp:buttoncont rol. 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

bc*******@yahoo .com napisal(a):
Hi, I have a input="type" control and two WebControls.But tons 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.
>


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="multip art/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="javas cript" id="txtFile" type="file"
onchange="txtSe ndFile.value=th is.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.

Aug 1 '06 #4

bc*******@yahoo .com wrote:
Gorgo wrote:
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:textb ox>" control and
one <Asp:buttoncont rol. 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

bc*******@yahoo .com napisal(a):
Hi, I have a input="type" control and two WebControls.But tons 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.
>


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="multip art/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="javas cript" id="txtFile" type="file"
onchange="txtSe ndFile.value=th is.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.

Aug 1 '06 #5

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

Similar topics

0
864
by: Frank | last post by:
In my aspx page, I use HtmlInputFile to ask user to select a file. When I select the file and hit submit button, 60% of the time I get "The page cannot be displayed". A postback event didn't happen at all. After lots of testing I find out it's the problem with HtmlInputFile html control. If I select a file and wait a while before I hit submit button, I am fine. BUT if I click to fast, I will get an error page. Did anybody have this...
7
1694
by: Al Smith | last post by:
Newbee to aspx needs direction. We are using an <INPUT type="file" tag to upload a file. We also have a text field for the user to enter a description for the file which the user must enter. Server side validation was being done for the description field having length and if not an appropriate message was written back to the client. However, in the process, the filename the user enters is not persisted between server calls...
5
3594
by: Ariel Dolan | last post by:
Can I use HtmlInputFile to only get the selected file name but not actually upload the file? Clicking the control's Browse button let's the user select a file. All I need is the HtmlInputFile Value property. However, any button clicked on the Html page results in uploading the selected file. Is there a way to avoid the actual uploading? Alternatively, is there any other way to let a user select a file name from his local disk?
2
1667
by: Augusto Cesar via DotNetMonster.com | last post by:
Hi, I want to customize the HtmlInputFile. I wanna something like an image button to play the "browse" button hole and hide the textbox. Is that possible? I also have tried to hide an HtmlInputFile in my page and added some javascript code to a button to fire the click() event of the HtmlInputFile. It worked for a moment, but when the submit button is clicked the HtmlInputFile looses its value. This solution was described in the...
2
2661
by: Sean Carey | last post by:
I converted a C# Upload app to VB.NET and am down to one error and was hoping someone could help me with te error. I would greatly appreciate help from anyone. Here is the error: c:\inetpub\wwwroot\admin\filemanager.aspx.vb(76): Expression is of type 'System.Web.UI.HtmlControls.HtmlInputFile', which is not a collection type.
5
1849
by: Reddy | last post by:
System.Web.UI.HtmlControls.HtmlInputFile.SaveAs(FileName) is not overwriting the file. It used to work fine on IIS5.1 Recently we migrated to IIS6.0. Since then it's not working. If it's new file it works fine. For the same file getting the error "Access to the path "" denied. I gave fullcontorl to ASPNET user on the folder. Please help me. Thanks reddy
1
1688
by: nes | last post by:
Hi all, For uploading files i am using the HtmlInputFile. Now I want to do 2 things with it. First I want to give the button a specific style and second when a postback happens I don't want the selected file to disappear from the HtmlInputFile. Now on the web I found the next thing: <html> <head>
8
1855
by: Nathan Sokalski | last post by:
I have a System.Web.UI.HtmlControls.HtmlInputFile control that I use to submit files. After the file is successfully submitted, I want the field to be reset so that the user knows the file was submitted. However, ASP.NET does not let you change the Value property of an HtmlInputFile control. How can I reset the HtmlInputFile control to it's original state? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
0
1164
by: gazza | last post by:
Hi, I have an application which shows a single record which has numerous image files stored. The images are displayed as thumbnails, and if I click on "Edit", an HtmlInputFile control is displayed next to each thumbnail allowing the user to change the image. Unfortunately, I have to have a separate normal asp.net button to firstly upload the selected image and also change the thumbnail. All of these controls are added dynamically at...
0
8310
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
8827
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
8732
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
8503
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
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2731
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
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1620
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.