Ticket Q373257
Visible to All Users

ASPxHyperLink - How to call a code-behind method by clicking the ASPxHyperlink

created 12 years ago (modified 12 years ago)

[DevExpress Support: This ticket is cloned from the ASPxHyperLink - How to show the hidden ASPxHyperLinks by clicking the other ASPxHyperLink ticket.]

Hi,
2. My second question is how do I call a code-behind method when I clcik the contactSave hyperLink to save the data.
Thank you,
Vadim

Answers approved by DevExpress Support

created 12 years ago (modified 12 years ago)

Hello Vadim,
You can implement the server-side processing by adding ASPxCallback to page and performing its callback:

ASPx
<dx:ASPxHyperLink runat="server" NavigateUrl="#" ID="contactSave" ClientInstanceName="cSave" CssClass="profileEditControls" Text="Save Contact Information" > <ClientSideEvents Click="function(s, e) { clb.PerformCallback('SaveData'); }" /> </dx:ASPxHyperLink> <dx:ASPxCallback ID="ASPxCallback1" runat="server" ClientInstanceName="clb" oncallback="ASPxCallback1_Callback"> </dx:ASPxCallback>
C#
protected void ASPxCallback1_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { if(e.Parameter == "SaveData") { //save to database } }

Please let me know if you need further assistance.
See Also:
Callback - Example
Callback Panel - Example

    Comments (1)
    VK VK
    Vadim Khachaturyan 12 years ago

      Thank you Larry.

      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.