回发后获得价值

编程入门 行业动态 更新时间:2024-10-26 18:29:28
本文介绍了回发后获得价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨... 我使用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> &nbsp; </td> <td> &nbsp; </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> &nbsp; </td> </tr> <tr> <td> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> </td> <td> &nbsp; </td> <td> &nbsp; </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>

更多推荐

回发后获得价值

本文发布于:2023-10-12 20:47:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1485860.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:价值   回发后

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!