473,395 Members | 1,440 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,395 software developers and data experts.

Problem with databinding in a composite control

Hi:

I'm creating some composite custom server controls that combine user
interface element and a validation control. One such control combines a
dropdownlist and required field validator. The problem is when I want to
use it on a form, how do I get a reference to the dropdownlist contained
within the control to call databind method? Also, if I call databind within
server control, it works but viewstate doesn't work. Does any know of any
example of how to do this?

Thanks,
Charlie
Nov 19 '05 #1
1 1109
Hi,

you would need to expose the DDL out as a property (or then expose certain
strategic properties like DataSource out from the control, and override
DataBind method, and call straight that of your composite control when
databinding
)
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Charlie@CBFC" <ch*****@comcast.net> wrote in message
news:ey**************@TK2MSFTNGP12.phx.gbl...
Hi:

I'm creating some composite custom server controls that combine user
interface element and a validation control. One such control combines a
dropdownlist and required field validator. The problem is when I want to
use it on a form, how do I get a reference to the dropdownlist contained
within the control to call databind method? Also, if I call databind
within
server control, it works but viewstate doesn't work. Does any know of any
example of how to do this?

Thanks,
Charlie

Nov 19 '05 #2

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

Similar topics

0
by: Satya Bojanapally | last post by:
Hi, I am unable to add a pager for this composite control. I had created a composite control in C#. The control is having 5 labels, one radio button and one DropDownList control. The composite...
2
by: John | last post by:
Hi, heres a brief description of what I'm trying to do. I have a sql table named colors that looks like this: color_id color_name 1 blue 2 red 3......... and so...
0
by: mike | last post by:
Hi there: I've read an excellent "how to"-article by Microsoft (no. 306227) - partly cited cited at the end of this email). I have implemented the code related to the part "How to Add a...
3
by: Eric | last post by:
I have built a composite user web control that I want to create dynamically. The form will contain a variable number of these controls and as well some of the contents of the user web control...
10
by: dx | last post by:
I have the Microsoft Press: Developing Microsoft ASP.NET Server Controls and Components book. It's starting to shine some light on control development but there is something about composite...
9
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...
2
by: Mark Goldin | last post by:
I am trying to create my first composite control. Here is the code: using System; using System.Collections; using System.ComponentModel;
0
by: Steve | last post by:
I'm trying to implement databinding on a composite control and I'm getting an error with the data when I change the DataSource. The first time I set the DataSource and call DataBind() everything...
8
by: Joey Chömpff | last post by:
L.S., Hello is there a way to implement 2-way databinding without using the datasources from dotnet 2.0. Why would you ask? Now that's simple. I've created an object model with BusinessObjects...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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
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...

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.