Problem: C # background get tr; result: C # <tr id= "a" runat= "server" > How do I find this TR ID in the background with FindControl?

Source: Internet
Author: User

C # <tr id= "a" runat= "server" > How do I find this TR ID in the background with FindControl? 2013-05-30 10:52 Anonymous | browse 470 times Share to:2013-05-30 The questioner adopted

. NET?

You don't have an ID, you just use it.

Ask:
I want to use it directly, but I don't know why I can't find the ID in the master page;
Label Lab = FindControl ("Label2") as Label;
Label this I directly use also say undefined, add the above code to find ...
Solve, I just want to find this ID in the master page
Chase Answer:
Halo, Master,,
Try the following
Master.findcontrol ("ContentPlaceHolder1"). FindControl ("a"]) as Label;

ContentPlaceHolder1 this to replace your
Ask:
You got it wrong, man, I'm not looking for a control for a content page in a master page, and a content page doesn't matter.
I just defined an ID on the master page, and then I can't find the ID in the background of the master page.

I give the label this example because I can't find the label control in the background of the master page, but I add
Label Lab = FindControl ("Label2") as Label;
This sentence will be found in the future.
So I want a sentence similar to this one, and the TR ID is also found.
Chase Answer:

, you can find it,

But there are several ways not to support it,

Ask:
Buddy Cow B Ah, the compilation passed, not prompt error. Although I do not know the future will not be a problem, but for the time being solved. Hey, still the TreeView is good to use AH. Thank you
Questioner evaluation
Thank you!

Problem: C # background get tr; result: C # <tr id= "a" runat= "server" > How do I find this TR ID in the background with FindControl?

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.