I have posted a comment on this article about finding controls on the content pages that use the master page,
Http://thcjp.cnblogs.com/archive/2006/07/08/446076.html
The following is a waste of at least four hours to come up with things. In fact, the main problem is that I made a mistake in the page execution sequence, which will take so long and depressing!
Protected void Page_Load (object sender, EventArgs e)
{
Repeater rp = (Repeater) Page. Master. FindControl ("Repeater1"); // It is the first step to figure out the Repeater control.
Rp. DataSource = dhdat; // if you want to bind the previous page, the number of items cannot be found below,
Rp. DataBind (); // so it is important here
Int coun = rp. Items. Count; // obtain the number of Repeater Items
For (int I = 0; I <coun; I ++) // loop all items
{
HyperLink diqu = (HyperLink) rp. Items [I]. FindControl ("HyperLink1 ");
// Find the HyperLink1 control, which is the word for navigation.
String aid = (Label) rp. Items [I]. FindControl ("Label1"). Text. ToString ();
// Because the Repeater does not have a primary key, at least I don't know it, so I put another Label to store the ID.
String url = "list. aspx? Aid = "+ aid + "";
// Because the URL has multiple conditions, the URL is constructed here.
If (Request. QueryString ["aid"] = null)
{
Diqu. NavigateUrl = url;
}
//. The specific judgments are boring.
}
}