Solved

c#, asp.net - filling a text box when FileUpload textbox is filled

Posted on 2009-05-05
3
1,696 Views
Last Modified: 2012-05-06
Hi,

I want to populate a textbox with the text of the textbox in a FileUpload.Once a file has been choosen and placed in the fileupload text box I want  textbox ID="fakefilepc"  to display the same text.  Does anyone know how to do this?

thanks
<asp:FileUpload ID="picFileUploadPhoto" runat="server" Width="250px" ></asp:FileUpload>// file to take Text from
 
 
 
<asp:TextBox ID="fakefilepc" runat="server"></asp:TextBox>// populate this text box

Open in new window

0
Comment
Question by:CharlieDev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Expert Comment

by:Maverick_Cool
ID: 24303323
fakefilepc.text = picFileUploadPhoto.PostedFile.FileName;
0
 
LVL 4

Accepted Solution

by:
cauos earned 500 total points
ID: 24303325
add this javascript function to your page
<script language="javascript">
function change()
{
var obj1 = document.getElementById("picFileUploadPhoto")
var obj2 = document.getElementById("fakefilepc")
obj2.value=obj1.value
}
</script>
and this event to the file uploader
<asp:FileUpload ID="picFileUploadPhoto" onchange="change()"  runat="server" />
0
 

Author Closing Comment

by:CharlieDev
ID: 31577949
Thanks!!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question