How to access the dashboard page from the content page

Source: Internet
Author: User

(1) In the page_loadcomplete event on the content page, you can use the master. findcontrol method to obtain the attributes of the master page control:

Code:

Protected void page_loadcomplete (Object sender, eventargs E)
{
Label2.text = (master. findcontrol ("label1") as label). text;

}

Label1 is the Control ID of the dashboard page.

 

(2) Use the mastertype command to obtain the reference code of the control on the dashboard page:

<% @ Page Language = "C #" masterpagefile = "~ /Masterpage. Master "autoeventwireup =" true "codefile =" default2.aspx. cs "inherits =" default2 "Title =" untitled page "%>
<% @ Mastertype virtualpath = "~ /Masterpage ....

The virtualpath attribute is used to set the URL address of the strongly typed dashboard page.

Reprinted: access the dashboard page from the content page

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.