Hi there. I've attached two files test2.aspx and test3.aspx
Test2 shows an ASPxTextBox bound to JQuery code to detect a copy or paste operation in the textbox. It works.
Test3.aspx is the same code, except it's in an ASP.Net Wizard control, it doesn't work. The document ready method only fires the first time the page is loaded, not when a step is navigated to.
Any idea as to what I must change in order to get this to work?
Thanks
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Norman,
Thank you for sending the pages' markup to me. I have examined them and suggest that you modify your scenario in the following manner: Since the rendering of the ASPxTextBox control is rather complex, it is necessary to attach the jQuery's event to the ASPxTextBox's input element (use the ASPxClientTextBox.GetInputElement method for this purpose).
In your scenario the ASPxTextBox control is placed inside the Wizard's WizardStep, which is not visible when the Wizard control is rendered initially. To attach the required scripts directly to the ASPxTextBox control, it is recommended to use its own client-side ASPxClientTextBox.Init event.
However, since there is no any DevExpress ASP.NET control onto the form the client-side programmatic object cannot be evaluated, because the Wizard control is placed inside the UpdatePanel control, which intercepts all postbacks inside it and converts them to callbacks. Therefore, it is necessary to register base DevExpress ASP.NET controls' scripts via the DevExpress.Web.ASPxClasses.ASPxWebControl.RegisterBaseScript(Page); method.
There is also a possible issue, that the jQuery's selectors are not registered after UpdatePanel's callback. So, to call them explicitely, it is necessary to specify the selector's name and call it after UpdatePanel's callback is completed.
I have attached a sample project, illustrating how you can implement the required functionality for both standard and DevExpress ASP.NET TextBox controls.
Thanks,
Mike
This response far exceeded my expectations. Thank you so much for your consice response and sample code. Excellent work!
Actually, it works in IE, but not FireFox 3.6. In FF, the page shows the upload panel progress indicator and the jquery doesn't work.
I narrowed it down to this line:
prm.add_pageLoaded(pageLoaded); changing it to endRequest helped, but didn't resolve.
Test file attached.
Hello Norman,
Thank you for the response. As I said earlier, the rendering of the ASPxTextBox control is rather complex, and it is necessary to attach the jQuery's event to the ASPxTextBox's input element, and it is not required to attach the jQuery's event again within the $(document).ready function.
The $(document).ready function is useful when it is necessary to attach jQuery's event to the input element of the standard ASP.NET control (the asp:TextBox control in the test2.aspx WebForm).
I have attached a modified project, illustrating the differences between using TextBoxes:
Thanks,
Mike
You mention that the ASPxTextBox control is rather complex, well, you've taken the complexity out of it for me :) Thank you so much for your time and attention to my requirement. It works just fine, Norman.