.net - How to get values from dropdownlist to bind, when this dropdownlist is from a UserControl? -
i have 3 dropdownlist (cbb_state, cbb_products, cbb_item) in usercontrol (ucproducs), have datasource each 1 (ods_state, ods_products, ods_item), , have .aspx page, using usercontrol.... , page has , objectdatasource must bind value 3 dropdownlist in usercontrol... i've tried examples, none of them helped me.
this usercontrol code file:
imports system.data.sqlclient partial class ucproducts inherits system.web.ui.usercontrol public property item() integer if cbb_item.selectedvalue <> "" return cbb_item.selectedvalue else return 0 end if end set(byval value integer) cbb_item.selectedvalue = value distrito = fc_produts.value) if value > 0 cbb_products.enabled = true end if end set end property public property state() integer if cbb_state.selectedvalue <> "" return cbb_state.selectedvalue else return 0 end if end set(byval value integer) if not value = 0 cbb_state.selectedvalue = value end if end set end property public property products() integer return cbb_products.selectedvalue end set(byval value integer) cbb_products.selectedvalue = value end set end property private function fc_pega_sub(byval index integer) integer 'my code end function private function fc_pega_distrito(byval value integer) integer 'my code end function protected sub cbb_regiao_selectedindexchanged(byval sender object, byval e system.eventargs) handles cbb_regiao.selectedindexchanged 'my code end sub end class
and in .aspx page:
<uc5:ucproduts id="ucprod" runat="server" />
how do that?
i did lol it's kind simple answer... because have createad property "products( )" when put usercontrol in page, had reference property binding column! here solution:
<uc2:products id="products" runat="server" products='<%# bind("fk_products") %>' />
Comments
Post a Comment