AJAX Question

Discussion in 'Software' started by jcast, May 2, 2012.

  1. jcast

    jcast Private E-2

    Hi;

    I have a page with one asp:popupmodalextender which work perfect, when I click select on every row of my grid I get the popup with 2 asp:linkbutton (save, cancel)

    Now I added a new asp:linkbutton to the popup (change) and this will bring another popup with also save and cancel.

    well somehow my second popup is blocking the save and cancel of my first popup; meaning when I click select I get the popup one but now the save and cancel are not working, and when I click change, I get the second popup but again save and cancel not working either.

    when I say not working meaning that the onclick doesn't fire up, the cancel button works I guess becasue I have the property CancelControlID and it just closing the popup but is not really calling the C# code behind when I click save or cancel.

    If I delete my second popup, my first popup works fine (save/cancel) y calling the code behind but when I add the second popup then is not working.

    looks like I am not using the second asp:popupmodalextender correctly.

    Please help, I am attaching my code.

    <%@ Register src="../Controls/CreditCardInput.ascx" tagname="CreditCardInput" tagprefix="uc1" %>
    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" src="../Scripts/jquery-1.4.1.js"></script>
    <script type="text/javascript" src="../Scripts/StringCapture.js"></script>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="pagetitle">Tasks</div>
    <asp:UpdatePanel runat="server" ID="upTasks" UpdateMode="Conditional">
    <ContentTemplate>
    <asp:DropDownList runat="server" ID="drdFilter" AutoPostBack="true" OnSelectedIndexChanged="drdFilter_SelectedIndexChanged">
    <asp:ListItem Text="New" Value="1"/>
    <asp:ListItem Text="Completed" Value="2"/>
    </asp:DropDownList>
    <br /><br />
    <asp:GridView runat="server" ID="gvTasks" AutoGenerateColumns="False" DataKeyNames="ID" onselectedindexchanged="gvTasks_SelectedIndexChanged" CssClass="listTbl" BorderStyle="None">
    <Columns>
    <asp:BoundField DataField="ID" SortExpression="ID" HeaderText="Number" />
    <asp:BoundField DataField="CreatedDt" SortExpression="CreatedDt" HeaderText="Created" />
    <asp:BoundField DataField="TaskType" SortExpression="TaskType" HeaderText="Task Type" />
    <asp:BoundField DataField="TaskStatus" SortExpression="TaskStatus" HeaderText="Status" />
    <asp:BoundField DataField="Description" SortExpression="Description" HeaderText="Description" />
    <asp:BoundField DataField="ProductLineId" SortExpression="ProductLineId" HeaderText="ProductLineId" />
    <asp:CommandField ShowSelectButton="true" ControlStyle-Width="50" />
    </Columns>
    </asp:GridView>
    </ContentTemplate>
    </asp:UpdatePanel>
    <asp:panel runat="server" ID="panViewTask" CssClass="popupDlg roundborder">
    <asp:UpdatePanel runat="server" ID="upViewTask" UpdateMode="Conditional">
    <ContentTemplate>
    <asp:ModalPopupExtender ID="panViewTask_ModalPopupExtender" runat="server"
    DynamicServicePath="" Enabled="True" BackgroundCssClass="popupBg" CancelControlID="lbViewTaskCancel"
    PopupControlID="panViewTask" TargetControlID="hlViewDetailsHidden" DropShadow="true" />
    <asp:HyperLink runat="server" ID="hlViewDetailsHidden" Text="Test" CssClass="invisible"></asp:HyperLink>
    <table class="formTbl width100">
    <tr>
    <td colspan="2" class="error"><asp:Label runat="server" ID="lblError" /></td>
    </tr>
    <tr>
    <th>ID</th>
    <td><asp:Label runat="server" ID="lblTaskId"></asp:Label></td>
    </tr>
    <tr>
    <th>Created Date</th>
    <td><asp:Label runat="server" ID="lbCreatedDate"/></td>
    </tr>
    <tr>
    <th>Task Type</th>
    <td><asp:Label runat="server" ID="lbTaskType"></asp:Label><asp:LinkButton CssClass="padding" runat="server" ID="lbChangeCCInfo" Text="Change" onClick="lbChangeCCInfo_Click"></asp:LinkButton></td>
    </tr>
    <tr>
    <th>Task Status</th>
    <td><asp:Label runat="server" ID="lbTaskStatus"></asp:Label></td>
    </tr>
    <tr>
    <th>Product Line ID</th>
    <td><asp:Label runat="server" ID="lbProductLineId"></asp:Label></td>
    </tr>
    <tr>
    <th>Customer Name</th>
    <td><asp:Label runat="server" ID="lbName"></asp:Label></td>
    </tr>
    <tr>
    <th>Phone Number</th>
    <td><asp:Label runat="server" ID="lbPhoneNumber"></asp:Label></td>
    </tr>
    <tr>
    <th>Rate Plan</th>
    <td><asp:Label runat="server" ID="lbRatePlan"></asp:Label></td>
    </tr>
    <tr>
    <th>Account Balance</th>
    <td><asp:Label runat="server" ID="lbAccBalance"></asp:Label></td>
    </tr>
    <tr>
    <th>Description</th>
    <td><asp:Label runat="server" ID="lbDescription"></asp:Label></td>
    </tr>
    <tr id="trCompleted" runat="server">
    <th>Completed</th>
    <td><asp:CheckBox runat="server" ID="chkCompleted"></asp:CheckBox></td>
    </tr>
    <tr id="trCompletedDate" runat="server">
    <th>Completed Date</th>
    <td><asp:Label runat="server" ID="lbCompletedDate"></asp:Label></td>
    </tr>
    <tr>
    <td colspan="2" class="buttonRow">
    <asp:LinkButton runat="server" ID="lbViewTaskSave" Text="Save"
    onclick="lbViewTaskSave_Click"></asp:LinkButton>
    <asp:LinkButton runat="server" ID="lbViewTaskCancel" Text="Cancel"
    onclick="lbViewTaskCancel_Click"></asp:LinkButton>
    </td>
    </tr>
    </table>
    <asp:panel runat="server" ID="panChangeCCInfo" CssClass="popupDlg roundborder">
    <asp:ModalPopupExtender ID="panChangeCCInfo_ModalPopupExtender" runat="server"
    DynamicServicePath="" Enabled="True" BackgroundCssClass="popupBg" CancelControlID="lbCCInfoCancel"
    PopupControlID="panChangeCCInfo" TargetControlID="lbChangeCCInfo" DropShadow="true" />
    <table class="formTbl">
    <tr>
    <th class="formHeader" style="font-weight:bold">
    Add New Credit Card Information
    </th>
    </tr>
    <tr>
    <td>
    <asp:Label runat="server" ID="lblCCNumber" />
    </td>
    </tr>
    <tr>
    <td>
    <uc1:CreditCardInput ID="ccInput" runat="server" />
    </td>
    </tr>
    <tr>
    <td class="buttonRow">
    <asp:UpdateProgress runat="server" ID="UpdateProgress1">
    <ProgressTemplate>
    <img src="../Images/progress.gif" / alt="">
    </ProgressTemplate>
    </asp:UpdateProgress>

    <asp:LinkButton runat="server" ID="lbCCInfoSave" Text="Save"
    onclick="lbCCInfoSave_Click"></asp:LinkButton>
    <asp:LinkButton runat="server" ID="lbCCInfoCancel" Text="Cancel"
    onclick="lbCCInfoCancel_Click"></asp:LinkButton>
    </td>
    </tr>
    </table>
    </asp:panel>
    </ContentTemplate>
    </asp:UpdatePanel>
    </asp:panel>
    </asp:Content>
     
  2. jcast

    jcast Private E-2

    Any ideas on why this is happening? I think I am using the asp:updatepanel incorrectly, but I dont know how to be able to use 2 popupmodalextenders in the same page and not to be block from one to another.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds