Tagged Posts with: c#

Add a Count Column to Your Gridview, Datalist or Repeater

November 30th, 2008 | Posted in ASP.NET
0

Found this great article on how to add a counter column to your data rich controls. http://www.lazyasscoder.com/AspNet/Article.aspx?id=55&title=How+To%3A+Add+a+row+count+column+to+a+GridView%2C+DataList+or+Repeater The above article is specific to a GridView. Here is an example with a Repeater control. <asp:Repeater ID="repeater" runat="server"> <ItemTemplate> <%# Container.ItemIndex + 1 %> <%# Eval("field_name") %>'> </ItemTemplate> </asp:Repeater>...

Add Items Dynamically to .NET Arrays with C#

November 30th, 2008 | Posted in ASP.NET
0

If you are in a situation where you need to add an item to an array you will need to use one of the collection classes such as the Arraylist. New values cannot be added to an array that has set values. String Array Example string[] list = new string[] { "one", "two", "three" }; ...

Find a Nested Web Control within a Web Control with C#

November 20th, 2008 | Posted in ASP.NET
0

I was having issues accessing a web control directly within a user control and used the following to access the web control within a LoginView in the User Control. The same syntax below can be used if you are looking for a nested control within a control. System.Web.UI.WebControls.Literal name_literal = (System.Web.UI.WebControls.Literal)this.LoginView1.FindControl("name"); name_literal.Text = "Text goes ...