473,484 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

What does the INamingContainer Inteface do?

Interface definitions do no not contain implementation, only
signtures. That is there real purpose. Here thow we have an Inteface
which does not have any implementation code but it has to be included
in the creation of a Web User Control. Please tell me how it actually
does something?

Regards

John L
Nov 19 '05 #1
3 9501
It's a marker interface..I'm not 100% sure how it works, but if you check
out how the constructor control work, you'll see:

if (this is INamingContainer){
this.flags[0x80] = true;
}
as you can see, it checks if the control implements INamingContainer, and if
it does, it sets a flag to a value...that's typically how marker interfaces
work...something checks if the object implements the interface, and if it
does, some magic is handled....how that's used from then on end, I'm not
sure....but what it actually does it ensure that controls are given unique
ids...this is important if you are creating composite controls or something
where you are specifying an ID for the dynamically created
child-controls...if you don't implement INamingContainer and you drop the
control twice on the same page (say for paging at the top and bottom of a
repeater), you'll have conflicting control IDs...INamingContainer ensures
that controls have a unique name. Additionally, without this uniqueness,
you'll likely run into problems with postback events not firing properly
because control Ids won't be appropriate...

HTH
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"gemel" <jo***@glenavon1.demon.co.uk> wrote in message
news:nh********************************@4ax.com...
Interface definitions do no not contain implementation, only
signtures. That is there real purpose. Here thow we have an Inteface
which does not have any implementation code but it has to be included
in the creation of a Web User Control. Please tell me how it actually
does something?

Regards

John L

Nov 19 '05 #2
Vko
Perferct answer :)
"Karl Seguin" wrote:
It's a marker interface..I'm not 100% sure how it works, but if you check
out how the constructor control work, you'll see:

if (this is INamingContainer){
this.flags[0x80] = true;
}
as you can see, it checks if the control implements INamingContainer, and if
it does, it sets a flag to a value...that's typically how marker interfaces
work...something checks if the object implements the interface, and if it
does, some magic is handled....how that's used from then on end, I'm not
sure....but what it actually does it ensure that controls are given unique
ids...this is important if you are creating composite controls or something
where you are specifying an ID for the dynamically created
child-controls...if you don't implement INamingContainer and you drop the
control twice on the same page (say for paging at the top and bottom of a
repeater), you'll have conflicting control IDs...INamingContainer ensures
that controls have a unique name. Additionally, without this uniqueness,
you'll likely run into problems with postback events not firing properly
because control Ids won't be appropriate...

HTH
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"gemel" <jo***@glenavon1.demon.co.uk> wrote in message
news:nh********************************@4ax.com...
Interface definitions do no not contain implementation, only
signtures. That is there real purpose. Here thow we have an Inteface
which does not have any implementation code but it has to be included
in the creation of a Web User Control. Please tell me how it actually
does something?

Regards

John L


Nov 19 '05 #3
Hi...

From the MSDN documentation:

"Any control that implements this interface creates a new namespace in which
all child control ID attributes are guaranteed to be unique within an entire
application. The marker provided by this interface allows unique naming of
the dynamically generated server control instances within the Web server
controls that support data binding. These controls include the Repeater,
DataGrid, DataList, ListBox, CheckBoxList, HtmlSelect, and RadioButtonList
controls."

Basically, this interface causes the ASP.NET runtime to do it's job relative
to control naming. It is a "marker" interface, meaning that some piece of
code, e.g., the ASP.NET runtime, will use its presence to take some action.

Hope this helps.

John Puopolo
..NET Fan

"gemel" <jo***@glenavon1.demon.co.uk> wrote in message
news:nh********************************@4ax.com...
Interface definitions do no not contain implementation, only
signtures. That is there real purpose. Here thow we have an Inteface
which does not have any implementation code but it has to be included
in the creation of a Web User Control. Please tell me how it actually
does something?

Regards

John L

Nov 19 '05 #4

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

Similar topics

3
6490
by: Derek Fountain | last post by:
The documentation says session_destroy() "destroys all of the data associated with the current session". Um, like what? The docs further say that you should remove all information in the _SESSION...
70
8800
by: Roy Yao | last post by:
Does it mean "(sizeof(int))* (p)" or "sizeof( (int)(*p) )" ? According to my analysis, operator sizeof, (type) and * have the same precedence, and they combine from right to left. Then this...
2
10192
by: Steve Richter | last post by:
What does the "." mean in the following sql script stmts? use GO if exists (select * from dbo.sysobjects where id = object_id(N'.') and OBJECTPROPERTY(id,N'IsUserTable') = 1) drop table ....
8
1704
by: Kim Forbes | last post by:
I am learning Javascript; and most books only give you partial definitions for the functions they show you. Here is a line of code from a browser sniffing function: var isWin =...
58
30155
by: Larry David | last post by:
Ok, first of all, let's get the obvious stuff out of the way. I'm an idiot. So please indulge me for a moment. Consider it an act of "community service".... What does "64bit" mean to your friendly...
2
5044
by: Tom | last post by:
I'm getting this error when I try to pass a structure to a dll. An unhandled exception of type 'System.ArgumentException' occured in Test1.exe Additional Information: Type could not be marshaled...
0
1116
arunmib
by: arunmib | last post by:
Hi all, I have doubt, as what does __declspec (dllimport) or __declspec(dllexport) does? If add these only the functions of a dll are exported or imported right? So what exactly does...
9
550
by: JoeC | last post by:
m_iWidth = (int)pBitmapInfo->bmiHeader.biWidth; m_iHeight = (int)pBitmapInfo->bmiHeader.biHeight; What does this mean? I have seen v=&var->member.thing; but what does it mean when you...
92
6110
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
2
13034
by: Lambda | last post by:
The code is simple: // Token.h #ifndef TOKEN_H #define TOKEN_H #include <vector> #include <string> class Token
0
7080
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
6950
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
7103
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
7140
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...
1
6811
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
4527
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...
0
3038
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
588
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
234
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...

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.