c# - MenusItems of WebDataMenu No Event Fires on the server -
i'm using remote webdatamenus
dynamically add items; through access forms , trigger events execution of function or logic defined.
the problem arises when want run vb.net code via itemclick
type event, event not working properly; or @ least can't work on server-side (it not fire), works great client-side through javascript.
it worth mentioning when click on items of menus run, vb.net code gives me javascript error '__dopostback' undefined
- how can make work , run event vb.net code?
ps: make work now, i'm running vb.net function javascript through instruction pagemethods.webdatamenu2_itemclick (eventargs.getitem (). get_key ());
setting enablepagemethods = true
property on scriptmanager
.
however, not allow me use other controls method run, gives me initialization error in each of controls.
i add menus , menus items.
-code html
<ig:webdatamenu id="webdatamenu2" runat="server" font-bold="false" font-names="arial narrow" font-overline="false" font-size="10px" width="100%" > <groupsettings orientation="horizontal" /> <clientevents itemclick="webdatamenu2_itemclick" /> </ig:webdatamenu>
-vb.net code adding items menus
ut = new infragistics.web.ui.navigationcontrols.datamenuitem ut.text = ds.tables(0).rows(0).item("x1").tostring() ut.tooltip = ds.tables(0).rows(0).item("x1").tostring() ut.key = "0" ut.imageurl = "~/imagestoolbar/employee20.gif" webdatamenu2.items.add(ut) ut = new infragistics.web.ui.navigationcontrols.datamenuitem ut.text = ds.tables(0).rows(0).item("x2").tostring() ut.tooltip = ds.tables(0).rows(0).item("x2").tostring() ut.key = "1" ut.imageurl = "~/imagestoolbar/timecard20.gif" webdatamenu2.items.add(ut)
currently add client-side event
function webdatamenu2_itemclick(sender, eventargs) { if (eventargs.getitem().get_key() != '') { alert('test2: ' + eventargs.getitem().get_key()); } }
vb.net code here trigger event in vb.net (here fails execute method)
protected sub webdatamenu2_itemclick1(sender object, e infragistics.web.ui.navigationcontrols.datamenuitemeventargs) handles webdatamenu2.itemclick nodotext = e select case nodotext case "0" session("it") = 2 session("i") = 1 ident = session("i") case "1" session("it") = 2 session("i") = 800 ident = session("i") case "2" session("it") = 2 session("i") = 5 ident = session("i") case "3" session("it") = 2 session("i") = 6 ident = session("i") case "7" session("it") = 2 session("i") = 39 ident = session("i") case "8" session("it") = 2 session("i") = 80 ident = session("i") case "4" session("it") = 2 session("i") = 100 session("ri") = 101 case else end select inicio() end sub
i tested in simple sample using code provided , works expected me. error __dopostback not being defined prevent server side event firing how asp.net post back.
i recommend check generated html file verify event defined:
function __dopostback(eventtarget, eventargument) { if (!theform.onsubmit || (theform.onsubmit() != false)) { theform.__eventtarget.value = eventtarget; theform.__eventargument.value = eventargument; theform.submit(); } }
if event defined check invalid html maybe missing closing tag or maybe have other invalid script on page causing issue.
Comments
Post a Comment