HtmlAnchor is highlighted after being clicked

Source: Internet
Author: User

HtmlAnchor is a link that remains highlighted after being clicked. The application is on the website background management interface. After you click the menu on the left, the menu remains highlighted.
To implement this function, it takes a lot of time for Insus. NET. Because the tag seems to have only one instantaneous state, it is difficult to catch up with it.

The following is the implementation process of Insus. NET. The basic part is to use this demo as material: http://www.cnblogs.com/insus/p/3205293.html.

To control the status of HtmlAnchor after clicking, we must know that HtmlAnchor has been clicked. In the previous demonstration, we can see that the href values of each HtmlAnchor are different. From this point, we can determine which HyperLink operator points. Only the href value can be found, and we can change the style of the link ).

OK, Insus. NET first writes an interface ):



This interface only has one write-only attribute. You can obtain the address of the webpage that opens the current page from the webpage opened by the link. Who will implement these interfaces? It can be seen from the interface that it is a value assignment. Therefore, we use the MasterPage master for implementation.



The following example shows the link HtmlAnchor on the master page. Insus. NET uses the override void Render () method to override the HtmlAnchor of the master page.



Then, link the target plane, GET Request. RawUrl, and pass it to the master MasterPage.



All pages (1 ~ 5). aspx. cs all need to use the above Code to give the address of the current page to the master.
The following is an example of the demo.



Related Article

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.