Devexpress Asp.net (1) client operation of aspxbutton)

Source: Internet
Author: User

20090626
Javascript calls the parent window (parent page) Method
Differences between window. Parent and window. Opener JavaScript calls the Main Window Method
1: window. parent is the parent page object called by the IFRAME page
2: window. opener is a child page opened by window. Open. It calls the parent page object.
The specific example will not be written.

 
Client verification of aspxbutton in devexpress. Web Control
When we use the. NET default aspbutton for face-to-face page submission, we usually need
This can be written as follows:

View plaincopy to clipboardprint?
  1. <Asp: buttonId = "btnsubmit" runat = "server" text = "Submit" onclientclick = "Return btnclick ();"/>

<Asp: button id = "btnsubmit" runat = "server" text = "Submit" onclientclick = "Return btnclick ();"/>If the verification fails, return false directly in the JS function validate, but aspxbutton does not,
It takes a lot of effort to find the appropriate method, as shown below:

View plaincopy to clipboardprint?
  1. <Dxe: aspxbuttonId = "btnsubmit" runat = "server" clientinstancename = "btnclientsubmit"
  2. TEXT = "Submit">
  3. <ClientsideeventsClick = "function validate (S, e ){
  4. If (txtmemo. gettext () = ''){
  5. Alert ('enter a valid value! ');
  6. E. processonserver = false;
  7. Return false;
  8. }
  9. }"/>
  10. </Dxe: aspxbutton>

<Dxe: aspxbutton id = "btnsubmit" runat = "server" clientinstancename = "btnclientsubmit" <br/> text = "Submit"> <br/> <clientsideevents click = "function validate (S, e) {<br/> If (txtmemo. gettext () = '') {<br/> alert ('enter a valid value! '); <Br/> E. processonserver = false; <br/> return false; <br/>}< br/>}"/> <br/> </dxe: aspxbutton>

In this event, processonserver is a very important attribute. By setting the value of this attribute (true/false), aspxbutton can execute its event programs on the server side.

 

Processonserver:
True: handles server-side events;
False: Process events on the client.

Remarks
E. processonserver = false: gets or sets a value to determine whether the program is executed on the server.
You can also say that if the control has the autopostback attribute, you can use E. processonserver to control whether the code is executed on the client or on the server. However, processonserver ultimately depends on the autopostback attribute. If the control autopostback = "false", the processonserver attribute value will not work.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.