Please Provide me solution to my problem it urgent and i know i have given long description please read it........
Problem: I am sending you the code. It Has two PArts First is CLIENT SECTION and Anpother is STATION Section
1) CLIENT SECTION : It has a dropdownlist binded to SQLDataSource and with this it has an imagebutton bAddClient
bAddClient will open the ModalPopup which will ask user to Add new client. And After Adding the New client when User
will close the ModalPopup MY DropDownList is not getting Populated with the New Client. I have Used UpdatePanels Also
But can't figure out where the problem is
2) STATION SECTION : It has a DropDownList, an Image BUtton , And Grid View. In Grid View it shows station details
on particular client selcted above.
i have given the delete station command on deleting the station that particular entry doesnot goes away.
It Should not be visible after it get deleted
Now when i click on imagebutton a modalpopup will open.
Now In modalpopup i have given dropdownlist , image button(to add new station), Some station Info and save button
Now when i click on dropdownlist it used to close the modalpopup then i seet the autopostback = false. Then it works fine. Is it correct way?
Now when i click on imagebutton it asks user to add new station with a textbox , save station button. When users click on savestation button
then it adds station to the DB and it should update the dropDownList of ModalPoup without closing it.
But when i am clicking on imagebutton it is closing the modalpoup. Please provide a solution to this
And When user clicks on ModalPoup SSave Button in end it should update GridView of STATAION SECTION too.
<%-- ************** CLIENT SECTION START HERE*******************--%>
<p class="heading">CLIENTS</p>
<br />
<asp:ScriptManager ID="smClientMgmt" runat="server" />
<asp:UpdatePanel ID="upCMClientInfo" ChildrenAsTriggers = "true" UpdateMode="Conditional" runat ="server" >
<ContentTemplate>
<asp:Table BorderStyle="Solid" BorderWidth="1" ID="Table1" runat="server" Width="850px">
<asp:TableRow>
<asp:TableCell Width="80px" CssClass="padcellleft"><asp:Label CssClass="labelSimple" ID="lblClientName" runat="server" Text="Client Name :"></asp:Label></asp:TableCell>
<asp:TableCell CssClass="padcellleft">
<asp:DropDownList ID="ddlClientName" runat="server"
DataTextField="Airline_Name" DataSourceID="sdcClientName" AutoPostBack="True">
</asp:DropDownList>
<asp:ImageButton runat="server" ID="bAddClient" ImageUrl="~/addButton.png"
ToolTip="Click to Add New Client"/>
<asp:TextBox ID="txtEditClientName" runat="server" Visible = "false" ></asp:TextBox>
</asp:TableCell>
<asp:TableCell >
<asp:SqlDataSource ID="sdcClientName" runat="server"
ConnectionString="Data Source=SONY-VAIO\SQLEXPRESS;Initial Catalog=GSA;Integrated Security=True"
SelectCommand="USP_GetListofAirline" ProviderName="System.Data.SqlClient" SelectCommandType="StoredProcedure" DataSourceMode="DataSet">
</asp:SqlDataSource>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
<asp:Table BorderStyle="Solid" BorderWidth="1" ID="Table3" runat="server" Height="187px" Width="850px">
<asp:TableRow>
<asp:TableCell>
<asp:Button ID="bSaveCl" runat="server" Text="SAVE" Visible="False"/>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
<cc1:ModalPopupExtender ID="mpAddClient" runat="server" PopupControlID="pnlAddClient" TargetControlID="bAddClient"
BackgroundCssClass="modalBackground" CancelControlID="btnCloseClMP">
</cc1:ModalPopupExtender>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Panel ID="pnlAddClient" runat="server" CssClass="modalPopup" align="center" style = "display:none">
<div>
<p class="heading">ADD NEW CLIENT</p>
<br />
<asp:UpdatePanel ID="upAddClient" runat ="server" >
<ContentTemplate>
<asp:Table BorderStyle="Solid" BorderWidth="1" ID="Table7" runat="server" Width="850px">
<asp:TableRow>
<asp:TableCell CssClass="padcellleft"><asp:Label CssClass="labelSimple" ID="Label1" runat="server" Text="Client Name :"></asp:Label></asp:TableCell>
<asp:TableCell CssClass="padcellleft"><asp:TextBox ID="txtClientNameMP" runat="server"></asp:TextBox> </asp:TableCell>
</asp:TableRow>
</asp:Table>
<asp:Table BorderStyle="Solid" BorderWidth="1" ID="Table8" runat="server" Height="187px" Width="850px">
<asp:TableRow>
<asp:TableCell>
<asp:Button ID="bAddClMP" runat="server" ToolTip="Click to save the New Client info" Text="ADD" />
</asp:TableCell>
<asp:TableCell CssClass="padcellright"></asp:TableCell>
</asp:TableRow>
</asp:Table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:Button ID="btnCloseClMP" runat="server" Text="Close" />
</asp:Panel>
<%--************************Now STATION Section Page Starts from Here******************************************************************
--%>
<p class="heading">STATIONS</p>
<br />
<asp:UpdatePanel ID="upCMStationList" runat ="server" >
<ContentTemplate>
<asp:Table BorderStyle="Solid" BorderWidth="1" ID="Table5" runat="server" Width="850px">
<asp:TableRow CssClass="TableRowheading">
<asp:TableCell Width="70px" CssClass="padcellleft"><asp:Label CssClass="labelSimple" ID="lblStation" runat="server" Text="Station :"></asp:Label></asp:TableCell>
<asp:TableCell CssClass="padcellleft">
<asp:DropDownList ID="ddlStation"
DataSourceID="sdcStationName" DataTextField="Station_name" runat="server" AutoPostBack="true">
</asp:DropDownList>
<asp:ImageButton runat="server" ID="bAddStation" ImageUrl="~/addButton.png"
ToolTip="Click to Add New Station" />
<asp:SqlDataSource ID="sdcStationName" runat="server"
ConnectionString="Data Source=SONY-VAIO\SQLEXPRESS;Initial Catalog=GSA;Integrated Security=True"
SelectCommand="USP_GetListofStation" ProviderName="System.Data.SqlClient" SelectCommandType="StoredProcedure" DataSourceMode="DataSet">
</asp:SqlDataSource>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
<asp:Table BorderStyle="Solid" BorderWidth="1" ID="Table6" runat="server" Height="187px" Width="850px">
<asp:TableRow>
<asp:TableCell CssClass="padcellleft" VerticalAlign = "Middle" Height="10px" >
<asp:Label CssClass="labelSimple" ID="lblListStations" runat="server" Text="List of Stations Configured for the above selected client"></asp:Label></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell VerticalAlign="Top">
<asp:GridView ID="grdStationList" runat="server" AutoGenerateColumns="false" BorderColor="#336699" BorderStyle="Solid"
BorderWidth="2px" ShowHeader = "true"
CellPadding="4" EmptyDataText="No Entries For Above Selected CLIENT" ForeColor="#333333" DataKeyNames="Station_Name" AllowPaging ="true">
<Columns>
<asp:BoundField DataField="Station_Name" HeaderText="Station Name"
SortExpression="StationName" />
<asp:ButtonField ButtonType="link" CommandName="FlightDetails"
HeaderText="Flight Details"
SortExpression="FlightDetails" Text="Flight Details"/>
<asp:ButtonField ButtonType="link" CommandName="StationDetails"
HeaderText="Station Details" SortExpression="StationDetails" Text="Station Details"/>
<asp:ButtonField ButtonType="link" CommandName="DeleteStationDetails"
HeaderText="Delete Station From Above Selected CLient" SortExpression="DeleteStationDetails"
Text="Delete This Station"/>
</Columns>
</asp:GridView>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
<cc1:ModalPopupExtender ID="mpAddStation" runat="server" PopupControlID="pnlAddStation" TargetControlID="bAddStation"
BackgroundCssClass="modalBackground" CancelControlID="btnCloseStnMP">
</cc1:ModalPopupExtender>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Panel ID="pnlAddStation" runat="server" CssClass="modalPopup" align="center" style = "display:none">
<div>
<p class="heading">ADD STATION</p>
<br />
<asp:UpdatePanel ID="upAddStation" runat ="server" >
<ContentTemplate>
<asp:Table BorderStyle="Solid" BorderWidth="1" ID="Table13" runat="server" Width="850px">
<asp:TableRow>
<asp:TableCell Width = "80px" CssClass="padcellleft"><asp:Label CssClass="labelSimple"
ID="lblStationName" runat="server" Text="Station Name:"></asp:Label></asp:TableCell>
<asp:TableCell CssClass="padcellleft">
<asp:DropDownList ID="ddlStationNameMP"
DataSourceID="sdcStationNameMP" DataTextField="Station_name" runat="server" AutoPostBack="false">
</asp:DropDownList>
<asp:SqlDataSource ID="sdcStationNameMP" runat="server"
ConnectionString="Data Source=SONY-VAIO\SQLEXPRESS;Initial Catalog=GSA;Integrated Security=True"
SelectCommand="USP_GetListofStation" ProviderName="System.Data.SqlClient" SelectCommandType="StoredProcedure"
DataSourceMode="DataSet">
</asp:SqlDataSource>
<asp:ImageButton runat="server" ID="bClickToAddNewStationMP" ImageUrl="~/addButton.png"
ToolTip="Click to Add New Station" />
</asp:TableCell>
<asp:TableCell Width="300px" CssClass = "padcellleft">
<asp:TextBox runat="server" ID="txtNewStationMP" Visible="false"></asp:TextBox>
<asp:Button runat="server" ID="bSaveNewStationMP" Visible = "false" Text="Save Station" ToolTip="Click to Save New Station"/>
<asp:Button runat="server" ID="bCancelSaveNewStationMP" Visible = "false" Text="Cancel" ToolTip="Click to Cancel"/>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
<asp:Table BorderStyle="Solid" BorderWidth="1" ID="Table14" runat="server" Height="187px" Width="850px">
<asp:TableRow>
<asp:TableCell>
<asp:Label CssClass="labelSubHeading" ID="lblStationMgr" runat="server" Text="Station Manager Information"></asp:Label>
</asp:TableCell>
<asp:TableCell CssClass="padcellright"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell CssClass="padcellleft"><asp:Label CssClass="labelSimple" ID="lblStationMgrName" runat="server" Text="Name :"></asp:Label></asp:TableCell>
<asp:TableCell CssClass="padcellleft"><asp:TextBox ID="txtStationMgrNameMP" runat="server"></asp:TextBox></asp:TableCell>
<asp:TableCell CssClass="padcellleft">
<asp:Label CssClass="labelSimple" ID="lblOfcPhone" runat="server" Text="Office Phone :"></asp:Label>
</asp:TableCell>
<asp:TableCell CssClass="padcellleft"><asp:TextBox ID="txtOfcPhoneMP" runat="server"></asp:TextBox></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell VerticalAlign="Top">
<asp:Button ID="bSaveStMP" runat="server" ToolTip="Click to Save Station Details" Text="SAVE" Visible="true"/>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:Button ID="btnCloseStnMP" runat="server" Text="Close" />
</asp:Panel>
</asp:ScriptManager>