R
Richard
Hi,
I want to have only one button to Upload file but i get Access denied
error.
Default.aspx.cs:
protected void Page_Load(object sender, EventArgs e)
{
FileUpload1.Attributes.Add("onchange",
"document.forms[0].submit();");
}
Default.aspx:
<head>
<script language="javascript" type="text/javascript">
function FileUpload1Click(){
document.getElementById("FileUpload1").click();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input type="button" onclick="javascript:FileUpload1Click();"
value="Attach file" runat="server" />
<input type="file" id="FileUpload1" runat="server"
style="display:none;" />
</form>
</body>
</html>
Is there a way of doing this with one click button only?
Any suggestions?
Richard
I want to have only one button to Upload file but i get Access denied
error.
Default.aspx.cs:
protected void Page_Load(object sender, EventArgs e)
{
FileUpload1.Attributes.Add("onchange",
"document.forms[0].submit();");
}
Default.aspx:
<head>
<script language="javascript" type="text/javascript">
function FileUpload1Click(){
document.getElementById("FileUpload1").click();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input type="button" onclick="javascript:FileUpload1Click();"
value="Attach file" runat="server" />
<input type="file" id="FileUpload1" runat="server"
style="display:none;" />
</form>
</body>
</html>
Is there a way of doing this with one click button only?
Any suggestions?
Richard