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

Stopping automatic declaration in code behind class

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
1 940
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Boban Dragojlovic | last post by:
I create a new webform (I always use codebehind), and I insert some server-side controls into the form (the ASPX) Later, I switch to codeview, and I notice that some (sometimes all) of the...
2
by: Simon Harris | last post by:
Hi All, I have a page which I want to accept an ID on the querystring - I'm trying to get this ID into a hidden form field. I have the following code at the top of my page: Line 5: <script...
29
by: Natan | last post by:
When you create and aspx page, this is generated by default: using System; using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Text; using...
1
by: Stephanie | last post by:
Hi. I am doing a tutorial http://www.15seconds.com/Issue/020319.htm About creating user controls in ASP.NET. As I run through the tutorial, there is a point after which I create a lovely...
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
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
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.