Update the update panel through triggers when another update panel does, because the first one must have UpdateMode = Conditional

I have some updates on the asp.net page. I want updatepanel 2 to update when Service Pack 1 is updated, but UpdatePanel 2 has its UpdateMode attribute assigned by Conditional and ChildrenAsTrigger = False, because it has another updated panel inside, and I need to control how it is updated. I tried to create a trigger for another update panel, but it seems to be inoperable, maybe I'm missing something

Is there any way to do this?

If you cannot provide a valid example, provide a list of product categories and a list of products, if you updated the list of products with a modified category (linkbutton in updatepanel), which is located inside another update panel, changing the list of products, for example, when you order by price (order is inside another update panel), and I don’t want the list of categories to be updated.

early.

+3
source share
2 answers

You can call updatePanelProdList.Update()in the code file of your page. Where this method is called in your script will be an event handler to change the LinkButton category.

+4
source

, ! 2 " " , , flexiGrid ( .net-, jQuery).

AsyncPostBack , .

function doPostBackAsync(eventName, eventArgs) {
    var prm = Sys.WebForms.PageRequestManager.getInstance();

    if (!Array.contains(prm._asyncPostBackControlIDs, eventName)) {
        prm._asyncPostBackControlIDs.push(eventName);
    }

    if (!Array.contains(prm._asyncPostBackControlClientIDs, eventName)) {
        prm._asyncPostBackControlClientIDs.push(eventName);
    }
    __doPostBack(eventName, eventArgs);
}

<a title="Edit" href="javascript:doPostBackAsync('Edit','2');">Edit</a>

string EventName = Request.Form["__EVENTTARGET"].ToString();
int EventValue = Request.Form["__EVENTARGUMENT"].ToString();

EventName EventValue,

protected void Edit(int id)
{
    //load the form here
    UpdatePanel1.Update(); //do the trick right, without this line unable to show form fields and other stuff with newly loaded data
}

.

( )

0

Source: https://habr.com/ru/post/1752365/


All Articles