Win Surprise Gifts!!!
Post New Question
Subscribe to Interview Questions
What is an attribute?
Posted By :
Posted Date :
October 23, 2008
It is a particular property, which describes the entity.
You can also find related Interview Question to
What is an attribute?
What is Attribute Programming? What are attributes? Where are they used?
Attributes are a mechanism for adding metadata, such as compiler instructions and other data about your data, methods, and classes, to the program itself. Attributes are inserted into the metadata and are visible through ILDasm and other metadata-reading tools. Attributes can be used to identify or use the data at runtime execution using .NET Reflection.
Default setting for the expires attribute of the document.cookie property?
The duration of the browser session.
Is the session Timeout attribute a sliding timeout value?
The session Timeout is a sliding expiration time, meaning whever your page access session state, the expiration time will be moved forward. Please note that as long as a page has NOT disabled session state, it will access the session automatically when requested.
A declaration in the form of public string this[int item] represents a
What is use of the AutoEventWireup attribute in the Page directive ?
The AutoEventWireUp is a boolean attribute that allows automatic wireup of page events when this attribute is set to true on the page. It is set to True by default for a C# web form whereas it is set as False for VB.NET forms. Pages developed with Visual Studio .NET have this attribute set to false, and page events are individually tied to handlers.
What is the Use of XMLIgnore attribute?
To prevent a member from being serialized during xml serialization
What is an attribute in XML?
An attribute is used to specify additional information about z XML element.
How do you select attribute of an XML elements using XPath ?
Attribute value of an element can be got by using @ symbbol:
Duration attribute of @OutputCache page directive In ASP
The @OutputCache directiveÃ¢â¬â¢s Duration attribute determines how long the page is cached.
If the duration attribute is set to 60 seconds, the Web form is cached for 60 seconds; the server loads the response in memory and retains that response for 60 seconds.
Any requests during that time receive the cached response.
Once the cache duration has expired, the next request generates a new response and cached for another 60 seconds.
What is the use of ServiceBehavior attribute in WCF ?
ServiceBehaviour attribute is used to specify the InstanceContextMode for the WCF Service class (This can be used to maintained a state of the service or a client too)
There are three instance Context Mode in the WFC
PerSession : This is used to create a new instance for a service and the same instance is used for all method for a particular client. (eg: State can be maintained per session by declaring a variable)
PerCall : This is used to create a new instance for every call from the client whether same client or different. (eg: No state can be maintained as every time a new instance of the service is created)
Single : This is used to create only one instance of the service and the same instance is used for all the client request. (eg: Global state can be maintained but this will be applicable for all clients)
Suppose you have created a WCF service. You have an interface stating your methods that must be exposed to the clients. But you have forgotten to specify "[OperationContract]" attribute in any of your method. What will happen ?
If you do not specify "[OperationContract] " in any of the methods in your interface then you will get the following error :-
IService1' has zero operations; a contract must have at least one operation
Here, Iservice is the name of my Interface. you can have your own name.
So, it is mandatory to label "[OperationContract] " attribute to at least one method while declaring your interface methods or ServiceContract.
Quick Links For Interview Questions Categories:
Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.
So, Start looking our
section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.
Hall of Fame
Terms of Service
Tell A Friend