我有一个从 MSDN 复制的 asp.net 表单上传框。提交表单后,我希望页面使用 2 个查询参数重定向,而不是在页面上显示信息,文件名和一个隐藏表单字段的数字,在同一个表单和上传框中。表单提交后如何获取该号码以添加到重定向代码。我的表单字段名称是“id”
<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, _
ByVal e As System.EventArgs)
If FileUpload1.HasFile Then
Try
FileUpload1.SaveAs("C:\inetpub\sites\rebbetzin\uploads\" & _
FileUpload1.FileName)
Label1.Text = "File name: " & _
FileUpload1.PostedFile.FileName & "<br>" & _
"File Size: " & _
FileUpload1.PostedFile.ContentLength & " kb<br>" & _
"Content type: " & _
FileUpload1.PostedFile.ContentType
Response.Redirect("http://www.rebbetzins.org/thanks.asp?id=" & ______ & "&f=" & FileUpload1.PostedFile.FileName )
Catch ex As Exception
Label1.Text = "ERROR: " & ex.Message.ToString()
End Try
Else
Label1.Text = "You have not specified a file."
End If
End Sub