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:
<Asp: Button ID = "Button1" runat = "server" Text = "Submit" OnClientClick = "validate ();"/>
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:
<Dxe: ASPxButton ID = "btnApply" runat = "server" OnClick = "btnApply_Click" Text = "add" AutoPostBack = "False">
<ClientSideEvents Click = "validate"/>
</Dxe: ASPxButton>
First, set the AutoPostBack attribute of AspxButton to False, and then add a client Click event,
This event is to perform some client verification,
Function validate (s, e ){
Var select = document. getElementById ("ddlSection ");
If (select. value = "0 "){
Alert ("select a valid value! ");
E. processOnServer = false;
Return false;
}
E. processOnServer = true;
}
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
ProcessOnServer allows you to specify whether the current Button should process client events or server events. If this attribute is set to false, a client event handler is executed, and the event is completely handled without being sent to the server on the client. Set the processOnServer attribute to True. The final event to be processed is on the server side, that is, the registered server-side event is triggered.