By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,903 Members | 2,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,903 IT Pros & Developers. It's quick & easy.

Stopping automatic declaration in code behind class

P: n/a
Here is the problem.

I have a parant class where I have declared couple of variables for user control that I will be using in the web pages. (ParentPage.vb)
This class is inherited by the code behind class. (WebPage.aspx.vb : Inherits ParentPage.vb)
In the aspx I have placed the user controls. (WebPage.aspx)

I'm using Visual Studio.NET and it automatically declares the those user controls in WebPage.aspx.vb.

Can I stop it somehow.

I had taken the following steps to no avail - Placed the user control directly into the template of WebForm and then used the template to create WebPage.aspx. This seemed to work, because when I switched from design to HTML view .. the declaration were not placed. However, when I closed and reopened the solution - the variables were declared! :(

Thanks in advance
Dhiman


Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

If I understood you correctly the declared variable in your base page
collide with automatic declaration of user control on derived pages.
You can:
1) Just declare user control on your base page and use findcontrol to
point your user control variable to actual control on derived page.
2) Dynamic load user controls on derived page:
http://www.aspfree.com/c/a/ASP.NET/D...r-Controls-in-
ASPNET/

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.