Ajax Modal Pop Up control issue

Last post 10-03-2008 5:32 AM by Zhi-Qiang Ni - MSFT. 1 replies.

Sort Posts:

  • Ajax Modal Pop Up control issue

    09-30-2008, 2:07 PM
    • Member
      21 point Member
    • pwzeus
    • Member since 07-31-2007, 2:29 PM
    • Posts 31

    Hey ,

    I have an edit image inside grid view rows. When you click on that image it will trigger the modal popup. The issues is it causes post back and causes entire grid to load the data again then it shows the popup.

     This is very slow, how can i determine on my page load that i m trying yo trigger popup and it should not go and load the grid again.

     

    thanks

  • Re: Ajax Modal Pop Up control issue

    10-03-2008, 5:32 AM
    Answer
    Hi,

    If the GridView is bound data when the form is on load the first time, we can add the IsPostBack checking: 
            protected void Page_Load(object sender, EventArgs e)
    {
    if (!IsPostBack)
    {
    //Your binding code.
    }
    }
    Another method is using the onClientClick property of the ImageButton: 
                                <ItemTemplate>
    <asp:ImageButton ID="ImageButton1" runat="server"
    ImageUrl="~/Control_Button.bmp" OnClientClick="showModal();return false;"/>
    </ItemTemplate>
          function showModal() {
    $find("ModalPopupExtender1").show();
    }
    Have my suggestions helped?

    Best regards,

    Zhi-Qiang Ni
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
    Answer” if a marked post does not actually answer your question.
Page 1 of 1 (2 items)