Mutiple Modal Popup inside one page problem

Discussion in 'Software' started by NeoBettyChen, Dec 12, 2008.

  1. NeoBettyChen

    NeoBettyChen

    Joined:
    Dec 12, 2008
    Messages:
    1
    I have a gridview in a usercontrol, here is what we want it happen when I click an image in the gridview header, a modal popup extender should show, and inside the modal popup panel, I have a textbox, if I enter something in the textbox and click ok button, the text inside the textbox should be applied to all the textbox in the gridview.

    This is working when the page only one this usercontrol.
    But I need 3 same usercontrols with different parameter in the same page, and now it’s working only when I click the image in the last gridview, for the first two the popup shows, but when I click to apply, nothing happened.

    Can you tell me what wrong with it, how should I fix it? Thanks in advance.

    Below is the code involved
    script type="text/javascript">
    function ok()
    {
    __doPostBack('<%= btApply.UniqueID %>', '' );

    }
    </script>

    <asp:panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none" Width="300px">
    Please enter your comment:
    <asp:TextBox runat="server" ID="tbCommentAll"></asp:TextBox>

    <div align="center">
    <asp:Button ID="btApply" runat="server" Text="Apply To All" OnClick="btApply_Click"/>
    <asp:Button ID="btCancel" runat="server" Text="Cancel" OnClick="btCancel_Click"/>
    </div>
    </asp:panel>

    <asp:GridView ID="gvTimeSheetDetail" runat="server" AutoGenerateColumns="False" ShowFooter="true" CssClass="subcontent" AllowSorting="True" OnRowDataBound="gvTimeSheetDetail_RowDataBound" OnSorting="gvTimeSheetDetail_Sorting" UseAccessibleHeader="False">
    --some other columns
    <asp:TemplateField >
    <HeaderTemplate>
    <asp:Label ID="Label1" runat="server" Text="Comment"></asp:Label>
    <asp:Image ID="lbAddComment" runat="server"
    ImageUrl="~/Images/message_add.gif"></asp:Image>
    <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
    BackgroundCssClass="modalBackground"
    TargetControlID="lbAddComment"
    PopupControlID="Panel1"
    DropShadow="true"
    OkControlID="btApply"
    OnOkScript ="ok()"
    CancelControlID="btCancel">
    </cc1:ModalPopupExtender>
    </HeaderTemplate>

    <ItemStyle HorizontalAlign="Left"></ItemStyle>
    <ItemTemplate>
    <asp:TextBox runat="server" ID="tbComment" CausesValidation="false" Width="250px" CssClass="InputTextShort">
    </asp:TextBox>
    </ItemTemplate>
    </asp:TemplateField>

    </asp:GridView>


    CS file:
    protected void btApply_Click(object sender, EventArgs e)
    {
    foreach (GridViewRow gvr in gvTimeSheetDetail.Rows)
    {
    TextBox tbComment = (TextBox)gvr.FindControl("tbComment");
    tbComment.Text = tbCommentAll.Text;

    }
    }

    protected void btCancel_Click(object sender, EventArgs e)
    {
    Panel1.Style.Add("display", "none");
    }
     
    NeoBettyChen, Dec 12, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. anil

    exam modal

    anil, Oct 16, 2003, in forum: MCSD
    Replies:
    0
    Views:
    586
  2. alienworkshop
    Replies:
    0
    Views:
    2,138
    alienworkshop
    Aug 17, 2006
  3. ambika

    mutiple classes in one file

    ambika, Sep 8, 2006, in forum: Software
    Replies:
    0
    Views:
    640
    ambika
    Sep 8, 2006
  4. Siva_iGate

    Modal Dialog

    Siva_iGate, Oct 18, 2007, in forum: General Computer Support
    Replies:
    1
    Views:
    970
    Siva_iGate
    Oct 18, 2007
  5. indira24

    name based ipsec -problem hostname resolves to mutiple IPs

    indira24, Mar 2, 2009, in forum: General Computer Support
    Replies:
    0
    Views:
    1,329
    indira24
    Mar 2, 2009
Loading...

Share This Page