ASP.NET VB.NET - Winforms to Web - implementing LostFocus listview control equivalent for web -


background: have winform app registers user in database based on information provided, auto-generates random password , username, , e-mails user link take application based on marketing company selected.

problem:

  • when user selects lbcarrier(s), bundles don't show in listbox b/c lostfocus feature doesn't work asp.net. code can use auto-populate bundles listbox based on selected in lbcarrier listbox asp.net.

web app screenshot

code default.aspx.vb:

private sub lbcarriers_lostfocus(byval sender object, byval e system.eventargs) handles lbcarriers.lostfocus     dim splt() string     dim ac1 array     bundles.items.clear()     each item in lbcarriers.items          splt = split(item.text, "|")         ac1 = proxy.getcontractingbundles("test", "test", trim(splt(0)))         each pitem in ac1             bundles.items.add(trim(splt(2)) & " | " & pitem.formbundlename)         next     next end sub  protected sub lbcarriers_selectedindexchanged(byval sender object, byval e eventargs) handles lbcarriers.selectedindexchanged  end sub 

you'll need client-side javascript, or add autopostback on dropdownlist , code onselectedindexchanged event:

<asp:dropdownlist autopostback="true" onselectedindexchanged="methodname" ... 

also, lostfocus event fires on client, not on server, , javascript event called "blur":

http://www.java2s.com/code/javascriptreference/javascript-methods/blur.htm


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -