473,511 Members | 15,852 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem setting properties to User control

I used the technique from this article
http://msdn.microsoft.com/asp.net/us...ercontrols.asp,
that set the properties to ViewState but I have 2 problems:
1. An object reference error when I tried to set user control's property
like the article did ( the sample code from the article actually worked )
2. When I created an instance of that user control to solve the problem from
#1, then set its property but it didn't take. ( I also tried to not use
ViewState but no work either )

The aspx file inherits Page and ascx file inherits UserControl like the
article has.

Anybody has this same problem or knows what I am doing wrong?

Thanks,
Lan
Nov 18 '05 #1
1 1257
It worked with FindControl method. Use it for now.

"Lan H. Nguyen" <la**@wizardones.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I used the technique from this article
http://msdn.microsoft.com/asp.net/us...ercontrols.asp, that set the properties to ViewState but I have 2 problems:
1. An object reference error when I tried to set user control's property
like the article did ( the sample code from the article actually worked )
2. When I created an instance of that user control to solve the problem from #1, then set its property but it didn't take. ( I also tried to not use
ViewState but no work either )

The aspx file inherits Page and ascx file inherits UserControl like the
article has.

Anybody has this same problem or knows what I am doing wrong?

Thanks,
Lan

Nov 18 '05 #2

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

Similar topics

18
18309
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
9
1511
by: Alphonse Giambrone | last post by:
I have built a simple composite control that consists of a textbox, requiredfieldvalidator and rangevalidator. For properties that are unique to the individual control, I set/get them directly...
0
1632
by: Tim::.. | last post by:
Hi... I'm having a big problem with a datagrid that obtains data from 2 different locations... Active Directory and SQL Database The data is inserted into a datatable and the sorted by a...
36
2431
by: AussieRules | last post by:
Hi, I want to use the user color scheme to set the color of my forms. I now I have to use the. System.Drawing.SystemColors, but which color is the color of a form background as used in other...
5
4062
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in...
2
1388
by: maflatoun | last post by:
Hi everyone, I have the following web user control. I like to set the properties dynamically without using page.databind. <uc1:partnerdownloads id="Partnerdownloads1" PropDomain="<%= Domain...
6
11058
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
14
3334
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using VS2005 and .net 2.0. I'm creating an application that has 3 forms. I want allow users to move forward and backward with the forms and retain the data users have entered. I thought...
2
1848
by: sumitmahajan81 | last post by:
I have created a user control and I add multiple instances of the same to a web page. Set its properties. But have different properties but they are not displayed properly. Properties of last...
0
7242
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,...
0
7138
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...
0
7418
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...
1
7075
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...
0
5662
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,...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3212
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
446
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...

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.