473,382 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Problem deriving from WebControl Class

I have an aspx form that conatains a WebControls.Table object. I also have
a class inheriting from the WebControl class. That class is instantiated
using the Table as a parameter, and adds checkboxes into rows / cells, as
shown in the code below.

The page loads fine, but after a postback, the checkboxes do not appear.

Can anyone provide assistance on getting them to persist?

Gary

public class RolesCheckBoxes : System.Web.UI.WebControls.WebControl

{

ImportContacts.BSTRoles _bstRoles = null;

Table _tbl;

string _test = string.Empty;

public RolesCheckBoxes( ImportContacts.BSTRoles bstRoles, Table tbl )

{

_bstRoles = bstRoles;

_tbl = tbl;

}

protected override void CreateChildControls()

{

Table tbl = _tbl;

TableRow row = new TableRow();

TableCell cell = new TableCell();

HyperLink a = new HyperLink ();

CheckBox ckBx = new CheckBox();

foreach (DataRow currRow in _bstRoles.Roles.Tables[0].Rows)

{

row = new TableRow();

cell = new TableCell();

ckBx = new CheckBox();

ckBx.Text = currRow["Name"].ToString ();

ckBx.ID = currRow["Code"].ToString ();

cell.Controls.Add (ckBx);

row.Cells.Add (cell);

tbl.Rows.Add (row);

}

tbl.BorderWidth = 1;

tbl.BorderStyle = BorderStyle.Ridge;

}

}

}
Nov 20 '05 #1
0 964

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Julian | last post by:
I would like to have output from my program to be written to cout as well as a file. (actually, i want several other output options but this should explain my problem in the simplest way). I have...
2
by: Bonj | last post by:
Hello Can anyone assist with the following class hierarcy problem? I have a series of window classes, the object model currently being as such: Window / | \ / | \...
3
by: Loïc | last post by:
Hello, I have created a simple webcontrol named MyControl tahat contains one single property. The property name is Columns , his type is ColumnCollection ( inherits from CollectionBase). this...
0
by: Harry F. Harrison | last post by:
Here's the situation...Context - Using an Inherited WebControl object as a base for server custom controls. In a web custom control, whenever I create a child control and add it to the Controls...
0
by: Lucas, Todd | last post by:
Hello everyone! I'm having a problem with a WebControl that I'm designing for a Menu. I've been at it for about 3 weeks now, and can't seem to get around this problem. So I'm hoping that someone...
3
by: Lisa Calla | last post by:
Hi, I'm trying to control the foreground and background colors of a textbox. I hate that light gray foreground when the textbox.enabled=false. I've tried to derive a control from the textbox,...
7
by: n33470 | last post by:
We're in the process of migrating our projects to use VS2005 from VS2003. We have a web page that uses the XML WebControl (System.Web.UI.WebControls.Xml) to perform an XSLT tranformation by...
3
by: J'son | last post by:
Guys, I have created a custom class that derives from DataList so that I can add some custom client side functionality into each new item row (<td>). Heres the class in its simplest form: ...
1
by: daniel_xi | last post by:
Hi all, I am running a VS 2003 .NET project on my client machine (Win 2000 SP4, ..NET framework 1.1), running an ASP.NET application on a remote web server (Win 2000 Server, IIS 6.0, .NET...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.