当我选择组合框项目时,删除或刷新附件文件

时间:2015-08-01 05:17:39

标签: asp.net vb.net file-upload combobox

我从电子邮件中开发了撰写邮件,

我附加文件然后我选择了组合框项目删除附件文件。

这是我的ASP代码:

<asp:UpdatePanel ID="updatepanel" runat="server">
                                            <ContentTemplate>
                                                <tr>
                                                    <td valign="top">
                                                        <asp:Label ID="lblfile_name" runat="server" CssClass="labels">Upload File</asp:Label>
                                                    </td>
                                                    <td>
                                                        <div style="overflow-y: scroll; z-index: auto; height: 60px;">
                                                            <asp:FileUpload ID="FileUpload1" runat="server" CssClass="multi" Visible="true" />
                                                        </div>
                                                    </td>
                                                </tr>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>


                                           <tr>
                                            <td>
                                                <telerik:RadComboBox EmptyMessage="----- Select -----" ID="cboTemplate" runat="server" Skin="WebBlue" AutoPostBack="true">
                                                </telerik:RadComboBox>
                                            </td>

                                        </tr>

这里是VB。网络代码

   Private Sub cboTemplate_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboTemplate.SelectedIndexChanged
    If cboTemplate.SelectedValue = "--Select--" Then
        lblErrMsg.Text = objcmnfunctions.GetErrMsg("B2B_WAR_110")
        SetFocus(anc_err)
        Exit Sub
    End If
    objdbconn.OpenConn()
    msSQL = " Select mailtemplate_gid, template_name, template_content " & _
            " from crm_trn_tmailtemplates " & _
            " where mailtemplate_gid = '" & cboTemplate.SelectedValue & "'"
    objOdbcDataReader = objdbconn.GetDataReader(msSQL)
    If objOdbcDataReader.HasRows = True Then
        objOdbcDataReader.Read()
        radmailcontent.Content = objOdbcDataReader.Item("template_content").ToString
    End If
    objOdbcDataReader.Close()
    objdbconn.CloseConn()
End Sub

1 个答案:

答案 0 :(得分:1)

将FileUpload1的值存储到会话对象

"SELECT * FROM tbl_name WHERE field REGEXP 'keyword1|keyword2|keyword3|keyword4'";

下拉列表清除上传值的原因是因为它设置为AutoPostBack =&#34; true&#34;