0

I have a gridview,bootstrap modal that is inside update panel on a content page which references master page.

There are 3 columns in my gridview and a linkbutton.

When Linkbutton event is fired javascript should be fired which isn't.

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(funct1);

I tried this but gives me sys undefined error in console.

Here's my code:

GridView -> View Button ->

var link = (Control)sender;
            GridViewRow row = (GridViewRow)link.NamingContainer;
            Label LiD = (Label)row.FindControl("LabelID");
            id = Convert.ToInt32(LiD.Text);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "funct1()", true)            
             MandateDetailusingId(id);

also tried with

//ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "MyFunction", "funct1()", true);

Here's my javacript :=

function funct1() {
            $('#<%=MandateView.ClientID%>').modal("toggle");
            return false;
        } // div id="MandateView"

How to up pop up modal ? everything is in updatepanel.

David
  • 75
  • 7
  • Check out https://stackoverflow.com/a/45442175/5836671 for the correct way to use `PageRequestManager` – VDWWD Apr 13 '19 at 10:01
  • @VDWWD I tried your method, it pops up modal on load. On button click it fires sys undefined. – David Apr 13 '19 at 10:40

1 Answers1

0

I finally ended up solving with

    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(InitialiseSettings);

function InitialiseSettings(){
    // replace your DOM Loaded settings here. 
    // If you already have document.ready event, 
    // just take the function part and replace here. 
    // Not with document.ready 
    $(element).slideUp(1000, method, callback});

    $(element).slideUp({
                   duration: 1000, 
                   easing: method, 
                   complete: callback});
}

event on page.

Thanks to this link.

https://stackoverflow.com/questions/14038684/execute-javascript-after-a-partial-postback-of-an-updatepanel
David
  • 75
  • 7