Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-05-05
3
Medium Priority
?
1,712 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

722 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