本文介绍了回发后获得价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨... 我使用One File上传,下拉列表和Button.But Droplist postback属性true我丢失fileupload值..参见此代码。解决方案ME。
< asp:ScriptManager ID = ScriptManager1 runat = 服务器 > < / asp:ScriptManager > < asp:UpdatePanel ID = UpdatePanel1 runat = server > < 触发器 > < asp:AsyncPostBackTrigger ControlID = DropDownList1 EventName = DropDownList1_SelectedIndexChanged / > <% - < asp:PostBackTrigger ControlID = DropDownList1 /> - %> < ; /触发器 > < ContentTemplate > < 表 class = style1 > < tr > < td > < asp:FileUpload ID = FileUpload1 runat = server / > < / td > < td > & nbsp; < / td > < td > ; & nbsp; < / td > < / tr > < tr > < td > < asp:DropDownList ID = DropDownList1 runat = server AutoPostBack = True OnSelectedIndexChanged = DropDownList1_SelectedIndexChanged > < asp:ListItem > 选择< / asp:ListItem > < asp:ListItem > 1 < / asp:ListItem > < asp:ListItem > 2 < / asp:ListItem > < ; / asp:DropDownList > < / td > < td > < asp:TextBox ID = TextBox1 runat = server > < / asp:TextBox > < / td > < td > & nbsp; < / td > < / tr > < tr > < td > < asp:按钮 ID = Button1 runat = server OnClick = Button1_Click 文本 = 按钮 / > < / td > < td > & nbsp; < / td > < td > & nbsp; < / td > < / tr > < / table > < / ContentTemplate > < / asp:UpdatePanel >解决方案
你不能保留fileupload控件的值,一旦重新加载页面,它将丢失文件名。
< 触发器 > < asp:PostBackTrigger ControlID = DropDownList1 / > < / Triggers >
Hi... I have use One File upload , Dropdown list and Button.But Droplist postback propertiy true i loss fileupload value..See this code.And Solution ME.
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <Triggers> <asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName ="DropDownList1_SelectedIndexChanged" /> <%--<asp:PostBackTrigger ControlID ="DropDownList1" />--%> </Triggers> <ContentTemplate> <table class="style1"> <tr> <td> <asp:FileUpload ID="FileUpload1" runat="server" /> </td> <td> </td> <td> </td> </tr> <tr> <td> <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"> <asp:ListItem>Select</asp:ListItem> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> </asp:DropDownList> </td> <td> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </td> <td> </td> </tr> <tr> <td> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> </td> <td> </td> <td> </td> </tr> </table> </ContentTemplate> </asp:UpdatePanel> 解决方案 you can not retain the value of fileupload control, once the page is reloaded it will lose the file name.<Triggers> <asp:PostBackTrigger ControlID ="DropDownList1" /> </Triggers>更多推荐
回发后获得价值
发布评论