How can i get the text in the file upload control
how can i get the text in the file upload control in a child page and put it to a label in a grid in the parent page.. plss help me
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VasanthRank #1,487 · 1.1K reputationPosted Mar 9, 2010, 8:24 PM EST
Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 9, 2010, 9:02 PM EST
Check below code tried to write some thing i understood with your words.
html xmlns="http://www.w3.org/1999/xhtml" > head id="Head1" runat="server"> title>Untitled Pagetitle> script type="text/javascript"> function triggerFileUpload() { document.getElementById("File1").click(); } function setHiddenValue() { document.getElementById("Hidden1").value = document.getElementById("File1").value; } script> head> body> form id="form1" runat="server"> div> input runat="server" id="Hidden1" type="hidden" /> input runat="server" id="File1" type="file" onchange="setHiddenValue()" style=" visibility:hidden;" /> br /> br /> asp:Button ID="Button1" OnClientClick="triggerFileUpload()" runat="server" Text="ASPNET Button" /> br /> br /> input id="Button2" type="button" onclick="triggerFileUpload()" value="HTML Button" /> br /> br /> asp:Button ID="Button3" runat="server" Text="Go CodeBehind To Get Input Value" /> div> form> body> html>protected void Button3_Click(Object sender, EventArgs e) { string uploadedFile=Hidden1.value; GridView gv=((GridView)Master.FindControl("gvUplaodedFiles")); // Now you have a reference of your grid control in your parent page. If it'nt working for you then send me how your child and parent controls are. // once you find the gridview you can add the label to the grid view. by finding control on grid view. }Hope you are getting some hint by my efforts.
Please mark as answer if it helps you.
imbet lugue14 reputationPosted Mar 10, 2010, 5:33 PM EST
Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 10, 2010, 7:36 PM EST
Please mark my answer if it helps you and help me back.