|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
cancel toolbar buttonclick from client-side javascriptpostback which drives the server-side events by using some client-side javascript, something along the lines of window.event.returnValue = window.confirm('test1'); within the onclick= or onbuttonclick= of the toolbar? When I try to add my own script to the onbuttonclick : <%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls, Version=1.0.2.116, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %> <iewc:toolbar id="tbTest" runat="server" onbuttonclick="test();"> <iewc:toolbarbutton text="165" imageurl="../../../images/btn_new.gif" id="btnTest"></iewc:toolbarbutton> </iewc:toolbar> it causes an error: Compiler Error Message: CS1026: ) expected Yet when I remove the onbuttonclick handler, the HTML rendered to the browser contains an onbuttonclick handler with all the postback logic: onbuttonclick="JScript:if (event.srcNode != null) if ((event.srcNode.getType() != 'checkbutton') || (event.srcNode.getAttribute('_autopostback') != null)) if (getAttribute('_submitting') != 'true'){setAttribute('_submitting', 'true');try{__doPostBack('Panel1$tbPanelToolbar',event.flatIndex);}catch(e){setAttribute('_submitting', 'false');}}" So I just want to interject in front of the canned script. Is that possible? John you are on the right track, but you will need to return false from the
function to suppress it. onbuttonclick="test();" return false; roughly -- Show quoteHide quoteRegards, Alvin Bruney [MVP ASP.NET] [Shameless Author plug] The Microsoft Office Web Components Black Book with .NET Now Available @ www.lulu.com/owc Forth-coming VSTO.NET - Wrox/Wiley 2006 ------------------------------------------------------- "John C." <vbhackatt***@hotmail.com> wrote in message 'true');try{__doPostBack('Panel1$tbPanelToolbar',event.flatIndex);}catch(e){news:1139854909.608976.136390@g44g2000cwa.googlegroups.com... > Hi, I'm using the webcontrols toolbar. Is it possible to cancel the > postback which drives the server-side events by using some client-side > javascript, something along the lines of > window.event.returnValue = window.confirm('test1'); > within the onclick= or onbuttonclick= of the toolbar? > > When I try to add my own script to the onbuttonclick : > <%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" > Assembly="Microsoft.Web.UI.WebControls, Version=1.0.2.116, > Culture=neutral, PublicKeyToken=31bf3856ad364e35" %> > <iewc:toolbar id="tbTest" runat="server" onbuttonclick="test();"> > <iewc:toolbarbutton text="165" imageurl="../../../images/btn_new.gif" > id="btnTest"></iewc:toolbarbutton> > </iewc:toolbar> > > it causes an error: > Compiler Error Message: CS1026: ) expected > > Yet when I remove the onbuttonclick handler, the HTML rendered to the > browser contains an onbuttonclick handler with all the postback logic: > onbuttonclick="JScript:if (event.srcNode != null) if > ((event.srcNode.getType() != 'checkbutton') || > (event.srcNode.getAttribute('_autopostback') != null)) if > (getAttribute('_submitting') != 'true'){setAttribute('_submitting', > setAttribute('_submitting', Show quoteHide quote > 'false');}}" > > So I just want to interject in front of the canned script. Is that > possible? > > John > Hi Alvin, I am returning false from my function but that doesn't really
matter since the javascript won't compile, as per the message "Compiler Error Message: CS1026: ) expected". It seems that it is not possible to specify the onbuttonclick handler in the tag because the IEWC doesn't support this. That is the crux of my question.
radiobuttonlist.selectedIndex always -1.........
Checkbox in datagrid.... How to read value of a dynamically created radiobuttonlist control? DataGrid Functionality Questions Checkbox state after postback asp.net control to run in web page like just COM refresh gridview asp:Repeater + no viewstate + DataBind() ?? Where are the events of the aspx? Looking for graphic control to use in .NET |
|||||||||||||||||||||||