开发者

While trying to retrieve the name of the uploaded document to another page it is showing empty

开发者 https://www.devze.com 2023-02-06 09:34 出处:网络
This is the code, to upload a document. <td class=\"style3\"> <asp:FileUpload ID=\"FileUpload1\" name=\"FileUpload1\" runat=\"server\" Width=\"330px\" />

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号