AJAX ModalPopup Problem

Last post 11-17-2009 5:31 AM by basinski. 6 replies.

Sort Posts:

  • Hmm [^o)] AJAX ModalPopup Problem

    11-11-2009, 7:15 AM
    • Member
      point Member
    • basinski
    • Member since 11-11-2009, 5:48 AM
    • Posts 4

    HI all!

    I searched now a little bit in the Forum but I did not find a answer to my problem. Perhaps anyone can help me..

    I have a GridView on a page with a template colum in which I have button ... this button calls a modalpopup in which the user can enter a text and then hit ok.

    After the ok button is pressed I will do a SQL-Command... but this is future.

    Momantary situation is, that i can create the popup and after a click on the OK button it dissapears but I am not be able to get the Information from the text box, because no postback is done and also the the prcedure "SaveData" defindes in the ONCLICK will not be reached.

    Did anyone know why??

     

    Greetings

    Sascha

     

    Here is some Code from my Side:

    TemplateColum in Grid (Works... shows the modal popup):

    <asp:TemplateField HeaderText="RÜCK" ShowHeader="False">
                    <ItemTemplate>
                        <asp:ImageButton ID="ImgBtnSend" runat="server" CausesValidation="false" 
                             ImageUrl="~/Images/S_T_MAIL.gif" Text="RÜCK" />
                        <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" 
                            BackgroundCssClass="ModalBG" OkControlID="imgModPanOK" 
                            PopupControlID="ModPanel" TargetControlID="ImgBtnSend">
                        </cc1:ModalPopupExtender>
                        <br />
                    </ItemTemplate>


    Panel which will be displayed as Popup (Works)...

       <asp:Panel ID="ModPanel" runat="server" Height="89px" Width="431px"
            BackColor="White" BorderStyle="Groove">
            <span class="style33">Vorgang an Markt zurückschicken</span><br />
            <br />
            <asp:Label ID="Label3" runat="server"
                Text="Bitte geben Sie einen Rücksedegrund ein!" style="font-size: small"></asp:Label>
            <br />
            <asp:TextBox ID="txtRSGrund" runat="server"
                style="font-family: Verdana; font-size: xx-small" Width="342px"></asp:TextBox>
             
            <asp:Button ID="imgModPanOK" runat="server" Font-Names="verdana"
                Font-Size="XX-Small" Text="OK" OnClick="SaveData" />
        </asp:Panel>

    SaveData defindes in the OnClick of the Button:

        Protected Sub SaveData(ByVal sender As Object, ByVal e As EventArgs)
            Dim s As String = HttpUtility.HtmlEncode(txtRSGrund.Text)
            '...to be continiued
        End Sub



     

  • Re: AJAX ModalPopup Problem

    11-11-2009, 7:44 AM
    • Member
      2 point Member
    • avinashpatil3484
    • Member since 02-13-2009, 10:25 AM
    • Pune/Delhi
    • Posts 3

    ok

    tell me button calls of modalpopup triggering any event means while debugging the breakpoint is hitting on that point.


    Avinash

  • Re: AJAX ModalPopup Problem

    11-11-2009, 8:06 AM
    • Member
      point Member
    • basinski
    • Member since 11-11-2009, 5:48 AM
    • Posts 4

    HI Avinash!!

    Thats my problem!

    I tried to check which event is called after clicking on the OK button in the Panel, but

    I did not find anything.

     

    I made breakpoints on page_load, SaveData, and also I tried GridView_RowCommand but i can not see anything happens.

    In the Tutorial of the ModalPopup it was described with the SaveData Method which I also implemented and wich does not work.

     

    Greetings

    Sascha   

  • Re: AJAX ModalPopup Problem

    11-11-2009, 8:09 AM
    • Participant
      1,641 point Participant
    • vishwaraj1
    • Member since 11-07-2008, 7:44 PM
    • India
    • Posts 424

     try  like this...
    
    
     <asp:Button ID="imgModPanOK" runat="server" Font-Names="verdana" 
                Font-Size="XX-Small" Text="OK" onclick="imgModPanOK_Click"/>
    
    protected void imgModPanOK_Click(object sender, EventArgs e)
        {
            //SaveData();
        }





    Regards:

    Vishwaraj Malik

    VB to C# Converter


    Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
  • Re: AJAX ModalPopup Problem

    11-11-2009, 8:40 AM
    • Member
      point Member
    • basinski
    • Member since 11-11-2009, 5:48 AM
    • Posts 4

    I tried...

    Nothing happens... ImgModPanOK_Click will not be reached also no postback will be done.

    Cry 

  • Re: AJAX ModalPopup Problem

    11-15-2009, 9:31 PM
    Answer

    Hi,

     In case as the OkControl, ImgModPanelOk will never trigger the postback.

    You can unbind OKControl so that let the postback work. In the event of imgModPanel, you can call modalpopup.Hide() to close it.


    Vince Xu
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: AJAX ModalPopup Problem

    11-17-2009, 5:31 AM
    • Member
      point Member
    • basinski
    • Member since 11-11-2009, 5:48 AM
    • Posts 4

    Good Morning everybody!

    Ok, I have done the changes and the Postback is done and the Event   ImgModPanelOk.Click event will be fired.

    The Modal Popup will also be closed!! GREAT!!

    Now my last problem with this......The calling object for the Modal Popup is a ImageButton in a Template Control of a GridView.

    This ImageButton has in its CommandArgument the Keys I need.

    When the ImgModPanelOk.Click Event in the Modal popup is fired then I dont know wich data row(ImageButton) has caused this, means I dont know the DataKeys of the gridrow which i need after the popup to do a SQL-Update.

    How can I solve that??

    Greetings

    Sascha

Page 1 of 1 (7 items)