C#
protected void Page_Load(object sender, EventArgs e)
{
btnFileUpload.Attributes.Add(
"onclick",
"document.getElementById('" + FileUpload2.ClientID + "').click();");
}Python
class="ViewContent">
ID="FileUpload2" runat="server" Width="317px" style="display: none"/>
id="btnFileUpload" type="button" value="Add" runat="server" style="width: 70px" />
ID="TextBox2" runat="server" Width="310px"/>Code
if (FileUpload2.PostedFile != null)
{
TextBox2.Text = System.IO.Path.GetFullPath(FileUpload2.PostedFile.FileName);
}
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 17, 2013, 6:49 AM EDT
I bit confuse about your query. By using the above code you are not getting complete path in your textbox?
Regards,
Iftikar
Alexander Dracka16 reputationPosted Aug 17, 2013, 6:55 AM EDT
<asp:FileUpload ID="FileUpload2" runat="server" Width="317px"
style="display: none" onchange="Metoda"/>
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 17, 2013, 7:09 AM EDT
Alexander Dracka16 reputationPosted Aug 17, 2013, 7:48 AM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 17, 2013, 7:55 AM EDT
in .css
Regards,
Iftikar
Alexander Dracka16 reputationPosted Aug 17, 2013, 7:58 AM EDT
function Test() {
var fu1 = document.getElementById("FileUpload2"); document.getElementById("TextBox2").value = fu1.value; }
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 17, 2013, 8:11 AM EDT
function SetFilePath()
{
var filePath = document.getElementById("FileUpload2").value;
document.getElementById("TextBox2").value=filePath;
}
Regards,
Iftikar
Alexander Dracka16 reputationPosted Aug 17, 2013, 8:20 AM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 17, 2013, 8:21 AM EDT
Regards,
Iftikar
Alexander Dracka16 reputationPosted Aug 18, 2013, 8:27 AM EDT