Computing.Net > Forums > Programming > asp.net 2.0: class file and .aspx page concep

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

asp.net 2.0: class file and .aspx page concep

Reply to Message Icon

Name: itags.org
Date: July 31, 2009 at 20:50:31 Pacific
OS: Windows 2003
CPU/Ram: intel 7300
Product: Microsoft Microsoft asp.net programming visual basic.net deluxe learing ed
Subcategory: General
Comment:

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:placeholder ID="PlaceHolder1".....>, 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.



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: August 2, 2009 at 09:15:47 Pacific
Reply:

1: Don't. Instead, make those pages call something in myClass.cs that returns your control.

2: See answer 1


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: asp.net 2.0: class file and .aspx page concep

ASP.NET 2.0 / VB.NET SetFocus() www.computing.net/answers/programming/aspnet-20-vbnet-setfocus/14600.html

MAster Pages in ASp.Net 2.0 www.computing.net/answers/programming/master-pages-in-aspnet-20/16271.html

Asp.net help! www.computing.net/answers/programming/aspnet-help/13485.html