I am trying to upload some files and send as an email. I have two update panels because when I click the Menu item, it automatically refreshes the whole page and hence no file will be attached. How do I stop it?
I want my page to hold the files until I click Button3 then it can perform the function of sending the email.
Attached is my code
<%@ Page Title="Home Page" Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="EDMSProject._Default" %><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"><title></title><style type="text/css">
.auto-style2 {
width: 186px;
}</style></head><body><form id="form1" runat="server"> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br /><br /><asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Check DocuTray " /><asp:ScriptManager ID="ScriptManager1" runat="server" /><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:FileUpload ID="FileUpload1" runat="server" AllowMultiple="True" /><br /></ContentTemplate><Triggers><asp:PostBackTrigger ControlID = "Button3"/> </Triggers></asp:UpdatePanel><asp:UpdatePanel ID="UpdatePanel2" runat="server"><ContentTemplate><asp:Button ID="Button2" runat="server" Text="Check History/Status" /><asp:Menu ID="Menu1" runat="server" OnMenuItemClick="Menu1_MenuItemClick" Orientation="Horizontal" style="margin-left: 41px"><Items><asp:MenuItem Text="Action" Value="Action"><asp:MenuItem Text="Forward" Value="Forward"></asp:MenuItem><asp:MenuItem Text="Save" Value="Save"></asp:MenuItem><asp:MenuItem Text="Close Ticket" Value="Close Ticket"></asp:MenuItem></asp:MenuItem></Items><StaticItemTemplate><%# Eval("Text") %></StaticItemTemplate></asp:Menu> <asp:Label ID="Label2" runat="server" Text="Department"></asp:Label><asp:DropDownList ID="DropDownList1" runat="server" DataTextField="Department" DataValueField="Department" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"></asp:DropDownList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:EDMSConnectionString %>" SelectCommand="SELECT * FROM [Employee]"></asp:SqlDataSource><br /><asp:Label ID="Label3" runat="server" Text="Client"></asp:Label><asp:DropDownList ID="DropDownList2" runat="server"><asp:ListItem>Pavis</asp:ListItem><asp:ListItem>Dove Associates</asp:ListItem></asp:DropDownList><br /><asp:Label ID="Label4" runat="server" Text="Recipient"></asp:Label><asp:DropDownList ID="DropDownList3" runat="server"></asp:DropDownList><asp:ListBox ID="ListBox1" runat="server" SelectionMode="Multiple"></asp:ListBox><br /><asp:Label ID="Label6" runat="server" Text="Subject"></asp:Label><asp:TextBox ID="TextBox2" runat="server" Width="182px"></asp:TextBox><br /><asp:Label ID="Label5" runat="server" Text="Message"></asp:Label><asp:TextBox ID="TextBox1" runat="server" Height="109px" Width="265px"></asp:TextBox><br /><asp:Button ID="Button3" runat="server" Text="Button" OnClick="Button3_Click" style="margin-left: 260px" /></ContentTemplate> </asp:UpdatePanel> </form> </body></html>