Asp.net manually obtains the returned event

Source: Internet
Author: User

So,
If it is a button or imagebutton, the request. Form [buttonid] is not empty,
If it is a linkbutton, the request. Form ["target"] is not blank. // The target here is incorrect. I forgot to spell it. Check the spelling.


In this way, you can call the myprocessevent function after page_load is complete:
Assume that you want to capture the buttons, imagebutton, and linkbutton IDS as follows:

BTN
IMG
Lnk

Private void myprocessevent ()
{
If (request. Form [BTN. uniqueid]! = NULL)
{
BTN control click return
}
If (request. Form [img. uniqueid + ". X"]! = NULL)
{
IMG control click return
}
If (request. Form ["target"] = lnk. uniqueid) // The target is incorrectly spelled.
{
Lnk control click return
}
}

In this way, you can capture the returned events.

This method is also applicable to controls such as dropdownlist and input.
 

The above text source: http://topic.csdn.net/t/20040808/14/3253421.html

This is something I found by chance. The purpose is to determine the event type in advance, so as to reasonably arrange the load and event processing sequence. It will be often used in the future, record here for future Query

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.