473,779 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Controls in UserControl: why empty?

Hi,

I've created a UserControl containing an <asp:Repeater > control, containing an <asp:Checkbox > control:

/-------------------------
<asp:Repeater Runat="server" ID="propRpt">
<ItemTemplate >
<tr><td>
<asp:CheckBox Runat="server" Text='<%#DataBi nder.Eval(Conta iner.DataItem," Description")%> ' TextAlign="Righ t"/>
<asp:Literal Runat="server" Visible="False" Text='<%#DataBi nder.Eval(Conta iner.DataItem," ID")%>'/>
</td></tr>
</ItemTemplate>
</asp:Repeater>
\-------------------------
On Page_Load (!PostBack), the <asp:Repeater > gets filled by database:

/-------------------------
propRpt.DataSou rce=...;
propRpt.DataBin d();
\-------------------------
On PostBack I want to iterate through the checkboxes to retrieve their values:

/-------------------------
foreach (RepeaterItem ri in propRpt.Control s)
{
if (((CheckBox)ri. Controls[1]).Checked)
ret[idx++]=Convert.ToInt1 6(((TextBox)ri. Controls[2]).Text);
}
\-------------------------

However, "(CheckBox)...C hecked" always yields false!?! Can someone please enlighten me on the reason? What did I do wrong?

Even more strange: If the page is displayed on Postback, the checked Checkboxes are actually displayed as being checked...
I'm having the same problem with a second UserControl of mine which is resembling the first but uses Textboxes instead of the Checkbox. I can't evaluate their values, too. Nonetheless, after PostBack they show the values I've entered. So it's not kind of an "EnableViewStat e problem".

TIA,
Axel Dahmen

Nov 17 '05 #1
0 1841

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

Similar topics

6
1480
by: Ben | last post by:
Hi I've got a problem with a custon control that inherits form the UserControl class and that used the overlib javascript library. The control works well in a standard form but when I used it in a datagrid, the properties that were binded from the database doesn't keep their value through the page_load of the custom control. By using breakpoints on the properties methods of the control, I saw that they were all correctly binded and that the...
6
8900
by: TomislaW | last post by:
How to find all user controls (ascx) loaded on a Page?
2
3113
by: Ric | last post by:
im new to asp.net. from what i understand, you have the aspx file (presentation), user-control(ascx file), code-behind(vb file) and components(compiled vb and dll files). the aspx file contains a reference to the ascx which can contain a reference to a component. can an aspx file contain a reference to an ascx file which contains a reference to a code-behind file? ive tried to do this then load the user-control via LoadControl(), but i...
0
2292
by: jonelling | last post by:
I am having a problem where the page load event is not being fired for certain user controls that I load dynamically in placeholders. Here is what I'm doing in brief, with full test code supplied at the bottom. In my controlling .aspx page, in the page_init() sub, if not postback, I load two user controls and place them in placeholders. This works and a trace statement in each user control's page load handler is executed on initial...
3
1473
by: Tumurbaatar S. | last post by:
Hi! I created some user control (ASCX) and it works fine. The control is created one of subfolders of my project, so its namespace looks like: namespace myproject.subfolder1 { public class route : System.Web.UI.UserControl .... In another subfolder I also created second control, but
8
3190
by: mark.norgate | last post by:
I've run into a few problems trying to use generics for user controls (classes derived from UserControl). I'm using the Web Application model rather than the Web Site model. The first problem I'm having is that the partial class signature in my projectDetails.ascx.cs file looks like this: public partial class ProjectDetailsControl<TEntryServiceProvider: UserControl, INamingContainer where TEntryServiceProvider : IEntryServiceProvider...
1
1127
by: Kyle K. | last post by:
Environment: Visual Studio 2005 + WinXP Pro SP2 + .NET 2.0 I am new to creating user controls and have a (hopefully) simple question. I have a series of personal questions (first/last name, address, phone number, etc.) that is repeated on several different pages. I pulled these question out into a UserControl to make it easier to maintain, etc. One problem... How do I specify validation logic for the controls contained in the...
1
2187
by: rudjohn | last post by:
I've been tasked with the not-enviable job of creating an application with multiple, semi-customizable templates. My basic concept, thus far, has been a combination of Master Pages (for layout) and WebPartZones. Each master page implements an interface (call it IMasterPage), which provides public properties for the WebPartManager and 3 WebPartZones. (Rule #1 was static number of zones.) However, each template can have these zones be...
8
1288
by: Brad Pears | last post by:
I am working on a contract generation application for our log home business. I have a main form that has many controls on it including tabbed controls, panes etc... When the user decides they want to do a new contract, they can click the "New" button and I will save any changes (if any) - then I want to clear the form to be ready for them to enter a new contract. Is there some easy mothod to clear controls on a form - or do I just...
0
9632
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9471
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10071
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9925
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8958
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4036
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.