asp.net - Update Panel & Event firing twice -
i have aspx page 3 dropdown boxes via infragistic controls. 1 of them inside updatepanel , 2 outside of updatepanel suppose control displayed in 3rd 1 via asynpostback event. both dropdown boxes outside of updatepanel call same function in code behind depending on object pass it, show in 3rd dropdown box. problem is, function appears getting triggered twice regardless of dropdown box select , each call passes control function , second 1 whats being displayed when click on first one. how stop that? i'm expecting function fire once depending on control select. tried have each dropdown box point own function , still both of them got triggered....
<td style="width:3px;"><asp:hiddenfield id="pnb_recno" runat="server" /></td> <td style="width:100px;">line of business:</td> <td colspan="2" width="150px"><!--onselectionchanged="pnb_product_list"--> <ig:webdropdown id="pnb_ddrgn" runat="server" width="175px" dropdowncontainerheight="100px" enabledropdownaschild="false" textfield="name" dropdowncontainerwidth="175px" font-size="11px" stylesetname="windows7" onselectionchanged="pnb_product_list" autopostback="true" clientevents-selectionchanged="pnb_chglob" > <items> <ig:dropdownitem text="" value="" /> <ig:dropdownitem text="global client access" value="global client access" /> <ig:dropdownitem text="solution center" value="solution center" /> <ig:dropdownitem text="both" value="both" /> </items> </ig:webdropdown> </td> <td style="width:3px;"></td> <td style="width:100px;">problem type:</td> <td colspan="2" width="150px"> <ig:webdropdown id="pnb_ddpblmtyp" runat="server" width="175px" dropdowncontainerheight="80px" enabledropdownaschild="false" textfield="name" dropdowncontainerwidth="175px" font-size="11px" stylesetname="windows7" autopostback="true" onselectionchanged="pnb_product_list"> <items> <ig:dropdownitem text="" value="" /> <ig:dropdownitem text="infrustructure" value="infrustructure" /> <ig:dropdownitem text="products" value="products" /> </items> </ig:webdropdown> </td> <td colspan="2" width="150px"> <asp:updatepanel id="pnb_udtpnlprdts" runat="server" updatemode="conditional"> <triggers> <asp:asyncpostbacktrigger controlid="pnb_ddrgn" eventname="selectionchanged" /> <asp:asyncpostbacktrigger controlid="pnb_ddpblmtyp" eventname="selectionchanged" /> </triggers> <contenttemplate> <ig:webdropdown id="pnb_ddprdts" runat="server" width="175px" enableclosingdropdownonselect="false" textfield="productname" enablepaging="false" dropdowncontainerheight="175px" enablemultipleselection="true" multipleselectiontype="checkbox" stylesetname="windows7" displaymode="dropdown"> <clientevents selectionchanged="selectedindexchanged" selectionchanging="selectedindexchanging" /> </ig:webdropdown> </contenttemplate> </asp:updatepanel> </td> protected void pnb_product_list(object sender, eventargs e) { try { using (sqlconnection sqlconnection = new sqlconnection(connectionstring)) { using (sqlcommand sqlcommand = new sqlcommand("dbo.getddproducts", sqlconnection)) { sqlcommand.commandtimeout = 0; sqlcommand.commandtype = commandtype.storedprocedure; if (!string.isnullorempty(pnb_ddrgn.currentvalue)) sqlcommand.parameters.addwithvalue("@lob", pnb_ddrgn.currentvalue); else sqlcommand.parameters.addwithvalue("@alert_type", pnb_ddpblmtyp.currentvalue); using (datatable datatable = new datatable()) { using (sqldataadapter dataadapter = new sqldataadapter(sqlcommand)) { dataadapter.fill(datatable); } pnb_ddprdts.datasource = datatable; pnb_ddprdts.databind(); } } } } catch (exception exception) { } }
i try looking autopostbackflags 1 selectionchanged , valuechanged possible infact because both these events being triggered why posting twice??
Comments
Post a Comment