Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Traversing children controls of user control get extra controls

Reply
Thread Tools

Traversing children controls of user control get extra controls

 
 
df
Guest
Posts: n/a
 
      05-17-2006
The user control can not be much simple:

<%@ Control Language="C#" AutoEventWireup="true"
CodeFile="SortOnListByClass.ascx.cs" Inherits="SortOnListByClass" %>
<asp:HyperLink ID="SortOnName" Text="Name" NavigateUrl="Name"
runat=Server/>

The traversing code is simple too:

protected void Page_Load(object sender, EventArgs e){
if(IsPostBack){
return;
}
foreach(Control Ctrl in Controls){

Response.Write(Ctrl.ToString();
}
}

But the resoult will get 2 controls:One is the real HyperLink,and
another is a Literal Control.Where does it come from?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controls traversing abcd ASP .Net 1 12-02-2009 03:12 PM
Does return-by-value mean extra copies and extra overhead? mathieu C++ 3 09-04-2009 04:25 PM
Composite Web Control and Dynamically Created Children Controls. Craig ASP .Net Building Controls 9 03-29-2005 12:11 AM
using javascript in User controls to access server controls of the user control Faizan Ahmed ASP .Net Building Controls 1 01-04-2005 04:09 PM
Control with simple ArrayList of children - parse as objects, not controls Todd ASP .Net Building Controls 0 10-08-2004 03:00 PM



Advertisments