Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Interview Questions
can we use session variable in App_code Class page ?
Posted By :
Posted Date :
December 18, 2009
By using "HttpContext.Current.Session("VarName") ", we can use current session variable in App_code Class page
You can also find related Interview Question to
can we use session variable in App_code Class page ?
How to remove a Session variable?
What namespace does the Web page belong in the .NET Framework class hierarchy?
Given the following methods of the ASP .Net Page class, in which of them would you attach an event handler to an event published by a control on the web page?
Is it possible to set SessionState to readonly mode? Readonly mode means, we can only read data from session but we can not write any data in session variable?
Yes, it is possible.
EnableSessionState property has a value "Readonly" which actually makes the session state read only.
Is it possible to share session information among ASP and ASPX page?
No,it is not possible as both of these are running under different processes.
When you inherit a protected class-level variable, who is it available to?
Classes in the same namespace.
If all the objects of a class need to be share the same variable, how must you declare that variable ?
shared variables must declared static
How will you maintain a Session values in Class Library?
Using HttpContext class
i have 3 aspx pages: page1.aspx, page2.aspx, page3.aspx. i have one Database table Employee (Empname, Age, EmpId, mobile, Country) with 1000 records inserted. now i want to retrieve the records in page1.aspx only once and i should use this data between the 3 pages without using Session variable. How to achieve this ?
need help on this question
What is The Difference Between Final variable,method,class IN Java.
Final variable - Like Constant.
Final method - Can't overridden.
Final class - Can't Inherited by Any other Class
What is the WebPartManager sealed class? Why do we add this on WebPart Page?
The WebPartManager sealed class is responsible for managing everything occurring on a WebPart page, such as the WebParts (controls), events, and misc. functionality that will occur in WebPartZones. For example, the WebPartManager is responsible for the functionality that is provided when you are working with moving a WebPart from WebPartZone to WebPartZone. It is known as the "the central class of the Web Part Control Set."
What is the difference between ViewState,Application and Session of a Page?
- View state is maintained in page level only.
- View state of one page is not visible in another page.
- View state information stored in client only.
- View state persist the values of particular page in the client (browser) when post back operation done.
- View state used to persist page-instance-specific data. (Read more)
- Session state is maintained in session level.
- Session state value is available in all pages within a user session.
- Session state information stored in server.
- Session state persist the data of particular user in the server. This data available till user close the browser or session time completes.
- Session state used to persist the user-specific data on the server side. (Read more)
ApplicationState is a variable you can store values in during the life off the application (may get cycled periodically, and without your knowledge) (used less-frequently)
- If you want to access the information on different web pages, you can use SessionState
- If you want to access from the same page, then you can use Viewstate
-Application State it's global, for all users
Session state provides more security when compared with view state as the data value is stored in server side
Which namespace is the base class for .net Class library?
What is the difference between a Struct and a Class?
The struct type is suitable for representing lightweight objects such as Point, Rectangle, and Color. Although it is possible to represent a point as a class, a struct is more efficient in some scenarios. For example, if you declare an array of 1000 Point objects, you will allocate additional memory for referencing each object. In this case, the struct is less expensive.
When you create a struct object using the new operator, it gets created and the appropriate constructor is called. Unlike classes, structs can be instantiated without using the new operator. If you do not use new, the fields will remain unassigned and the object cannot be used until all of the fields are initialized.
It is an error to declare a default (parameterless) constructor for a struct. A default constructor is always provided to initialize the struct members to their default values.
It is an error to initialize an instance field in a struct.
There is no inheritance for structs as there is for classes. A struct cannot inherit from another struct or class, and it cannot be the base of a class. Structs, however, inherit from the base class Object. A struct can implement interfaces, and it does that exactly as classes do.
A struct is a value type, while a class is a reference type.
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