This is the code, to upload a document.
<td class="style3">
<asp:FileUpload ID="FileUpload1" name="FileUpload1" runat="server" Width="330px" />
</td>
This is the code in vbscript
<script language ="vbscript " runat ="server" >
Protected Sub save_Click1(ByVal sender As Object, ByVal e As System.EventArgs)
Call save_doc()
End Sub
Public Sub save_doc()
Dim filename As String
filename = Request("FileUpload1")
Response.Redirect("mynew_page.aspx? Filename=" & filename)
End Sub
</script>
i am redirecting to mynew_page.aspx page开发者_如何学Python. in this page i am writing code like this
<body>
<form id="form1" runat="server">
<div>
Welcome
filename: <% = Request("Filename")%>
</div>
</form>
</body>
But at finally the name of the uploaded document is not coming. it just showing blank only. please help me
Try the following:
filename = FileUpload1.FileName
Where FileUpload1
is an instace of your FileUpload control (declared in your page markup).
精彩评论