Only one instance of scriptmanager can be added to the page.
When the dropdownlist + Ajax cascade is implemented in the formview control, the entire page can only have one scriptmanager control, and the scripmanager control cannot be placed in the formview, but should be placed in the form, before the formview control, otherwise, the error "only one instance of scriptmanager can be added to the page" appears.
<Body> <Form ID = "form1" runat = "server"> <asp: scriptmanager id = "scriptmanager1" runat = "Server "> </ASP: scriptmanager> <! -- ASP: scriptmanager is here,One is enough.--> <Div> <Asp: updatepanel id = "updatepanel1" runat = "server"><! -- ASP: updatepanel 1 here --> <div> <Contenttemplate> <! -- Contenttemplate container --> <div> <Asp: Label id = "label1" runat = "server" text = "label"> </ASP: Label> <asp: button id = "button1" runat = "server" text = "button"> </ASP: button>
<Contenttemplate> <asp: dropdownlist id = "ddlbrand" runat = "server" autopostback = "true"> <asp: listitem text = "select the brand" value = "0"/> </ASP: dropdownlist> </contenttemplate> <triggers> <asp: asyncpostbacktrigger controlid = "ddlcarxid" eventname = "selectedindexchanged"/> </triggers> </ASP: updatepanel><! -- ASP: updatepanel 2 here --> <div>
<Asp: dropdownlist id = "ddlcarxid" runat = "server"> <asp: listitem text = "select the car series" value = "0"> </ASP: listitem> </ASP: dropdownlist> </div> </form> </body>