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

controls are not recognized in a class file

Hi,

I need a few sql queries results so I created a new class with has a
few functions that load the data.
After executing ExecuteReader, I need to load the data to the
dropdownlist control.
The problem is that the control isn't recognized in the new class
(recognized only in Default.aspx.vb) -none of the controls of
default.aspx is recognized in the new class.

Any idea?
What am I missing?

Thanks.
Ruthie.

Feb 12 '07 #1
2 1894
Controls belong to the page. The new class knows nothing about the page.

Mixing controls with data access code in the same class is not a good idea.
A better solution is to get the methods of the class return data access
objects like datareaders, datatables, datasets, leave all the controls on
the page and databind the controls to the objects returned from the class.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
<ru******@walla.co.ilwrote in message
news:11*********************@k78g2000cwa.googlegro ups.com...
Hi,

I need a few sql queries results so I created a new class with has a
few functions that load the data.
After executing ExecuteReader, I need to load the data to the
dropdownlist control.
The problem is that the control isn't recognized in the new class
(recognized only in Default.aspx.vb) -none of the controls of
default.aspx is recognized in the new class.

Any idea?
What am I missing?

Thanks.
Ruthie.

Feb 12 '07 #2
On Feb 12, 3:12 pm, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@mMvVpPsS.orgwrote:
Controls belong to the page. The new class knows nothing about the page.

Mixing controls with data access code in the same class is not a good idea.
A better solution is to get the methods of the class return data access
objects like datareaders, datatables, datasets, leave all the controls on
the page and databind the controls to the objects returned from the class.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net

<ruthi...@walla.co.ilwrote in message

news:11*********************@k78g2000cwa.googlegro ups.com...
Hi,
I need a few sql queries results so I created a new class with has a
few functions that load the data.
After executing ExecuteReader, I need to load the data to the
dropdownlist control.
The problem is that the control isn't recognized in the new class
(recognized only in Default.aspx.vb) -none of the controls of
default.aspx is recognized in the new class.
Any idea?
What am I missing?
Thanks.
Ruthie.- Hide quoted text -

- Show quoted text -
Thanks Eliyahu.
Your answered my question.

Feb 12 '07 #3

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

Similar topics

1
by: | last post by:
Hi Guys, I am generating dynamic server controls using XML and XSLT. With this I am generating two buttons which when clicked redirect the page to a different page. Here is my "checkout"...
4
by: Danny | last post by:
I have installed Internet Web Controls locally in my machine, and in our server. I also added them into the toolbox tab in my Visual Interdev and on design layout, I can see the treeview object...
5
by: Mattia Saccotelli | last post by:
Hi to all. I'm trying to auto-save a form to XML using Page.Controls property. Almost everything is fine, except a really weird behavior with the HtmlTextArea control. I noticed that if it has a...
5
by: siaj | last post by:
Hello All, Can any one give me a clue when to use Web Server controls/ HTML server controls/HTML Controls. As I understand .. HTML controls should be used if u dont need to refer it in the code...
2
by: D Hass | last post by:
Radio Buttons are added to my form During the Load event, the quantity determined by User input. They are placed in pairs on groupboxes with code like this: (edited a bit for brevity) Public...
4
by: Ê÷Éϲä»Ò | last post by:
'rar' is not recognized as an internal or external command, operable program or batch file. import os import time source = target_dir = r'e:\temp\bak' target =...
0
by: mivhaelveloz | last post by:
Hiya Im trying to get a user control working in mono/ASP.NET. ....I have no problem getting a basic control up and working and using it declaratively in a hosting page's .aspx file. But for...
4
by: Dica | last post by:
i need to dynamically add a web control to a page without using placeHolder. i'm looping through all the files in a folder and creating a table row as string for each file. the contol is to be...
1
by: =?Utf-8?B?Q2hyaXN0aWFuIFdlaW5lcnQ=?= | last post by:
Hello, I currently fight with a problem during the derivative of WinForm controls. In Visual Studio I created a new User Control. This control is derived from the DataGridView of the...
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...
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
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
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
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...

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.