Getpostbackeventreference vs getpostbackclienthyperlink

Source: Internet
Author: User
Clientscriptmanager. getpostbackeventreference method andThe clientscriptmanager. getpostbackclienthyperlink method has the same functions. All scripts are generated on the client. When a specific event of the control is triggered, it can be sent back to the server.

Their performance on the client is a little different. getpostbackclienthyperlink performs as: javascript :__ dopostback ('mycontrol1', 'myanchor1'), and getpostbackeventreference performs as :__ dopostback ('mycontrol1 ', 'myancor1 ').

Where getpostbackeventreference can be used, it should be replaced by getpostbackclienthyperlink (personal opinion, for reference only ). However, it is not necessarily where getpostbackclienthyperlink can be used. I have read the source code of the two methods and called getpostbackclienthyperlink within the getpostbackclienthyperlink method. Internal   String Getpostbackclienthyperlink (Control, String Argument, Bool Escapepercent, Bool Registerforeventvalidation)
{
Return("Javascript:" + This. Getpostbackeventreference (control, argument, escapepercent, registerforeventvalidation ));
}

 

What I wonder is, since getpostbackeventreference can be used instead of getpostbackclienthyperlink (personal opinion, for reference only), why does Microsoft not merge it into a method? In this way, you do not need to consider the differences between the two methods. I hope some friends can give a reasonable explanation.

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.