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?