473,770 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp.net 2.0: class file and .aspx page concept question

How can you get a class such as myClass.cs, to create a control such
as a listbox that wil be used in a placeholder control on an .aspx page
where the .aspx page has yet to be created so the class doesn't know
about it yet. (e.g so there are no dependencies in the class)..

So if there are 10 .aspx pages, page1.aspx, page2.aspx, etc. , and each
one has a control <asp:placeholde r ID="PlaceHolder 1"......>, how do
you

1. code a class, myClass.cs to create a listbox that will be placed on
any one of the above .aspx pages but in the <PlaceHolder1 > control. (I
know how to do it with a user control e.g. default.aspx and
default.aspx.cs -- but how to do it with default.aspx, default.aspx.cs
AND myClass.cs).
2. instantiate this code from myClass.cs from the page1.aspx.cs,
page2.aspx.cs, etc.

Thanks!

May 25 '06 #1
1 1208
I think my response in the previous thread is on the right track. If your
base class declares PlaceHolder1 and your pages create it via
<asp:placeholde r id="placeholder 1" runat="server" /> your baseclass will
have a reference to the placeholder and can creaste the listbox and place it
into it. This can be done in the onLoad event of the baseclass or by calling
a "CreateList Box" protected method of the base class...

Karl

--
http://www.openmymind.net/

"Ranginald" <da*******@gmai l.com> wrote in message
news:11******** **************@ j55g2000cwa.goo glegroups.com.. .
How can you get a class such as myClass.cs, to create a control such
as a listbox that wil be used in a placeholder control on an .aspx page
where the .aspx page has yet to be created so the class doesn't know
about it yet. (e.g so there are no dependencies in the class)..

So if there are 10 .aspx pages, page1.aspx, page2.aspx, etc. , and each
one has a control <asp:placeholde r ID="PlaceHolder 1"......>, how do
you

1. code a class, myClass.cs to create a listbox that will be placed on
any one of the above .aspx pages but in the <PlaceHolder1 > control. (I
know how to do it with a user control e.g. default.aspx and
default.aspx.cs -- but how to do it with default.aspx, default.aspx.cs
AND myClass.cs).
2. instantiate this code from myClass.cs from the page1.aspx.cs,
page2.aspx.cs, etc.

Thanks!

May 25 '06 #2

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

Similar topics

4
7023
by: BH | last post by:
I'm looking at the source code of the ASP.NET forum sample application. It has the "code-behind" classes compiled into a separate DLL, totally separated from the aspx/ascx files. Adding the class files alone in VS.NET is straightforward, but is there a way configure VS.NET to add aspx/ascx files alone?
7
1304
by: +The_Taco+ | last post by:
Ok i'm kinda new to ASP.NET. I got like 4 aspx pages right now, all with there aspx.vb codebehind. Each of them need to connect on the same database, so what I want to do is to create a module or a class, wich contain a function to connect to the database. How to I include a class or a module to my codebehind pages? May someone give me a hint? thx a lot guys.
5
3161
by: Marcel Gelijk | last post by:
Hi, I am trying to create a User Control that is located in a seperate class library. The User Control contains a textbox and a button. The page generates an exception when it tries to access the code variable that are supposed to be linked to the contained controls. It runs fines when everything is contained in a single web form project. What do I need to do to make it work from a class library?
13
1858
by: Duron | last post by:
I created a new folder using VS.NET 2003. Then I created a new web form under that folder, say, \Member\Default.aspx. However, even if I didn't do anything to that page, a run-time error appears when I try to run it -- Can not load class MySite._Default. I am using VB to write codes. Does anyone have any idea why this problem happens? Thanks!
6
2119
by: rodchar | last post by:
Hey all, I'm trying to understand Master/Detail concepts in VB.NET. If I do a data adapter fill for both customer and orders from Northwind where should that dataset live? What client is responsible for instantiating the orders class? Would it be the ui layer or the master class in the business layer? thanks,
4
1638
by: Bob | last post by:
In ASP.NET 1.1, I have a base page for all my pages in an application. The base page contains some common properties that every page needs, the code behind file of every page looks like this: public class Home : MyBasePage { ..... } and in it I can simply refer them as base.MyProperty (or just this.MyProperty). This seems no longer possible in the ASP.NET 20 master
2
2327
by: Hiten | last post by:
Is it possible to have more code behind file but that file will have same class in way of partial class, Default Structure I -------------- Homepage.aspx + Homepage.aspx.cs (this .cs file will have "Homepage" class which is partial)
1
2724
by: pbd22 | last post by:
hi. i have been posting this here and elsewhere a lot and can't seem to get resolution on this problem. i have been trying to upload files using a hidden iframe to a asp.net/vb.net form. the problem is that the server code can't read the httpfilecollection. the count is always zero. my upload form's form tag looks like this:
2
3321
by: Reggie | last post by:
Hi and TIA! I have a class file located in my root directory with all me web pages. I call/use the class and it works fine. I have no imports statements aspx or codebehind. My question is why? I thought the class file had to be compiled and placed in the bin directory or added to the App_Code(as a class file) folder. I don't have it in either it's simply in the root. Now When I compile it and place the dll in the bin and remove the...
0
9617
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
9453
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
10254
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
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...
0
9904
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
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
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
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
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.