Beruflich Dokumente
Kultur Dokumente
<script runat="server">
protected void Page_Load(Object sender, EventArgs e) {
lbl_msg.Text = DateTime.Now.ToString();
}
</script>
<body>
<h3>Output Cache example</h3>
<p>Page generated on:
<asp:label id="lbl_msg" runat="server"/></p>
</body>
</html>
For example, if you specified a value of 'Client' for the Location attribute of
an OutputCache directive on a page, the page would not be saved in the
server cache, but the response would include a Cache-Control header (
Pages can indicate whether they should be cached on a proxy by using the
Cache-Control header.) value of private and an Expires header (HTTP
response, indicating the date and time after which the page should be
retrieved from the server again ) with a timestamp set to the time indicated
by the Duration attribute
Fragment Cache
<script runat="server">
protected void Page_Load(Object src, EventArgs e)
{
_date.Text = "User control generated at " +
DateTime.Now.ToString();
}
</script>
<asp:Label id='_date' runat="'server'" />
Here I have user caching on user control, so when ever we used in a page ,
only partial page will be cached.
Data Cache
Data Cache is used to storing frequently used data in the Cache memory. It's
much efficient to retrieve data from the data cache instead of database or other
sources. We need use System.Web.Caching namespace. The scope of the data
caching is within the application domain unlike "session". Every user can able to
access this objects.
leave a comment »
When the browser requests a page from the web server, the browser and the
web server make a connection that last long enough to process that particular
request. After the web server has rendered a page to the browser, the connection
is terminated. A subsequent request to the same web server for the same page is
processed as a new request.
When the user requests an ASP.NET web page, a new instance of the page is
created. The page performs its processing, renders markup to the browser, and is
then discarded. If the user clicks a button to perform a postback, a new instance
of the page is created, the page performs its processing, and is again discarded.
Thus, each postback and round trip results in a new instance of the page.
Latest answer: Fragment caching refers to the caching of individual user controls
within a Web Form. Each user control can have independent cache durations and
implementations of how the caching behavior is to be applied.............
Read answer
What is partial classess in .net?
Latest answer: Partial classes allow us to divide the class definition into multiple
files (physically). Logically, all the partial classes are treated as a single file by the
compiler............
Read answer
User doesn’t have to remember separate user names and passwords for various
Web sites
User can maintain his or her profile information in a single location.
Passport authentication also avail access to various Microsoft services, such as
Passport Express Purchase.
What is caching?
Caching is the technique of storing frequently used items in memory so that they
can be accessed more quickly.
By caching the response, the request is served from the response already stored
in memory.
It’s important to choose the items to cache wisely as Caching incurs overhead.
A Web form that is frequently used and does not contain data that frequently
changes is good for caching.
A cached web form freezes form’s server-side content and changes to that
content do not appear until the cache is refreshed.
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 a ViewState?
ASP.NET - What is ViewState? Explain its benefits and limitations - May 08, 2009
at 17:40 PM by Shuchi Gauri
Advantages:
i) No server resources.
ii) Viewstate ensures security because it stores the data in encrypted format.
iii) Viewstates are simple. They are used by enabling or disabling the viewstate
properties.
iv) It is based on the wish of developer that they want to implement it at the page
level or at control level.
Disadvantages:
i) If large amount of data is stored on the page, then page load might cause a
problem.
ii) Does not track across pages. Viewstate information does not automatically
transfer from page to page.
Read answer
Latest answer: Src: is a way mention the name of the code-behind class to
dynamically compile on the request for a page. ...............
Src: is a way mention the name of the code-behind class to dynamically compile
on the request for a page.
Code-behind: is the logic written behind the UI design file. It specifies the name of
the compiled file that contains the class. Code-behind attribute is only used
for.Net.
Read answer
Latest answer: URI - Uniform Resource Identifier: it’s a string and its responsibility
is to identify a resource by meta-information. It gives information about only one
resource............
URI - Uniform Resource Identifier: it’s a string and its responsibility is to identify a
resource by meta-information. It gives information about only one resource.
URL - Uniform Resource Locator: identifies the resource on the net and tells it is
obtainable using what protocols
Read answer
During development, it allows you to make changes to the web pages and reuse it
using the same web browser to validate the changes without compiling the entire
website.
Read answer
Latest answer: Custom controls are user defined controls. They can be created by
grouping existing controls, by deriving the control from
System.Web.UI.WebControls..........
Custom controls are user defined controls. They can be created by grouping existing controls, by deriving the control
from System.Web.UI.WebControls.WebControl or by enhancing the functionality of any other custom control. Custom
controls are complied into DLL’s and thus can be referenced by as any other web server control.
Read answer
Latest answer: An operating system process can have many ongoing application
domains. Application Domains keep an application separate. All objects created
within the same application scope are created within the same application
domain...........
Read answer
Explain the two different types of remote object creation mode in .NET. [Hint
SAO and CAO]
Latest answer: SAO Server Activated Object (call mode): lasts the lifetime of the
server. They are activated as SingleCall/Singleton objects. It makes objects
stateless...........
Read answer
1. Server
2. Client: This connects to the hosted remoting object
3. Common Interface between client and the server .i.e. the channel..........
Read answer
Latest answer: Singleton architecture is to be used when all the applications have
to use or share same data...........
Read answer
Latest answer: The LeaseTime property protects the object so that the garbage
collector does not destroy it as remoting objects are beyond the scope of the
garbage collector. Every object created has a default leasetime for which it will be
activated..........
Read answer
Latest answer: Every service listed has a URI pointing to the service's DISCO or
WSDL document, which is needed to access the webservice and its 'webmethod"
methods..........
Read answer
Latest answer: Create a new website by selecting "ASP.NET Web Site" and giving
it a suitable name. service.cs file appears inside the solution with a default
webmethod named as "HelloWorld()"........
Read answer
What is Scavenging?
Latest answer: A process where items are removed from cache in order to free
the memory based on their priority. A property called "CacheItemPriority" is used
to figure out the priority of each item inside the cache...........
Read answer
Latest answer: Page output: Is used to fetch information or data at page level. It is
best used when the site is mainly static. Used by declaring the output page
directive............
Read answer
Show with an example how to Cache different version of same page using
ASP.NET Cache object.
Latest answer: The ways to cache different versions on the same page using
ASP.NET cache object is using OutputCache object............
Read answer
Latest answer: Fragment cache is to store user controls individually within a web
form in cache instead of the whole webform as such. The idea is to simply have
different cache parameters for different user controls.............
Read answer
Latest answer: Types of sessions: InProc: The default way to use sessions. InProc
is the fastest way to store and access sessions...........
Read answer
What are the benefits and limitations of using hidden fields?
Latest answer: Advantages: Easy to implement, Hidden fields are supported by all
browsers, Enables faster access of information because data is stored on client
side............
Read answer
Latest answer: Advantages: Hidden frames allow you to cache more than one
data field, The ability to cache and access data items stored in different hidden
forms...........
Read answer
Latest answer: Advantages: They are simple to use. Light in size, thus occupy less
memory. Stores server information on client side. Data need not to be sent back
to server........
Read answer
What is QueryString and what are benefits and limitations of using querystring?
Latest answer: Absolute and sliding expiration are two Time based expiration
strategies. Absolute Expiration: Cache in this case expires at a fixed specified date
or time..............
Read answer
Explain how to access ViewState value of this page in the next page.
Latest answer: PreviousPage property is set to the page property of the nest page
to access the viewstate value of the page in the next page. Page poster =
this.PreviousPage;..........
Read answer
Latest answer: SQL Cache Dependency in ASP.NET: It is the mechanism where the
cache object gets invalidated when the related data or the related resource is
modified.........
Read answer
Latest answer: Users of different countries, use different languages and others
settings like currency, and dates. Therefore, applications are needed to be
configurable as per the required settings based on cultures, regions,
countries........
Read answer
Explain the concepts of CODE Page approach. What are the disadvantages of
this approach?
Latest answer: Code Page was used before Unicode came into existence. It was a
technique to represent characters in different languages..........
Read answer
What are resource files and explain how do we generate resource files?
Latest answer: Resource files are files in XML format. They contain all the
resources needed by an application. These files can be used to store string,
bitmaps, icons, fonts........
Read answer
Latest answer: Al.exe: It embeds the resources into a satellite assembly. It takes
the resources in .resources binary format.......
Read answer
Latest answer: WCF is a framework that builds applications that can inter-
communicate based on service oriented architecture consuming secure and
reliable web services.............
Read answer
Latest answer: WCF can create services similar in concept to ASMX, but has much
more capabilities. WCF is much more efficient than ASP.Net coz it is implemented
on pipeline............
Read answer
Latest answer: Read Uncommitted: - Also known as Dirty isolation level. It makes
sure that corrupt Data cannot be read. This is the lowest isolation level............
Read answer
Latest answer: Volatile Queues: There are scenarios in the project when you want
the message to deliver in proper time. The timely delivery of message is very
more important and to ensure they are not lost is important too. Volatile queues
are used for such purposes.............
Read answer
Latest answer: There are 3 types of workflows in WWF: Sequential Workflow: The
sequential workflow style executes a set of contained activities in order, one by
one and does not provide an option to go back to any step...........
Read answer
Latest answer: Script injection attacks called Cross-site scripting (XSS) attacks
exploit vulnerabilities in Web page validation by injecting client-side script
code.............
Read answer
Latest answer: Authentication is the process of verifying user’s details and find if
the user is a valid user to the system or not. This process of authentication is
needed to provide authority to the user........
Read answer
What is Authorization in ASP.NET?
Login controls are part of ASP. Net’s UI controls collection which allows users to
enter their username and password to login to a website/application. They
provide login solution without the need of writing code...........
Read answer
Fragment caching does not cache a WebForm, rather it allows for caching of
individual user controls within a Web Form, where each control can have
different cache duration and behavior...........
Read answer
.Net2.0 supports the concept of partial classes which is unlike the concept of one
class one file. In .Net technology, one can define a single class over multiple files
using the concept of partial classes............
Read answer
Yesyoucandoitusingahyperlink<BR><ahref="Abc.aspx?name=test">Click to go to
aspx </a>.............
Read answer
Discussion Board
ASP.NET questions
Exhaustive and quality exercise, have been using this site for my preparation for
interview.
FormsAuthentication.SignOut()
System.data
System.data.oledb
System.data.sqlclient
System.xml
Datareader
Dataset
Windows authentication
Passport authentication
Forms authentication
Template column
Page.Validate
Tracing
Session.abandan
What are different IIS isolation levels?
-InProc
-StateServer
-SQLServer
-Page_Init
-Page_Load
-Control events
-Page_Unload event
RequiredFieldValidator
RangeValidator
CompareValidator
RegularExpressionValidator
CustomValidator
ValidationSummary
What is reflection?
-Reflection is used to browse through the metadata information.
-Using reflection you can dynamically invoke methods using
system.Type.Invokemember
System.MarchalByRefObject
Marshal-by-value
Marshal-by-reference
What is a Assembly?
- Private assembly
- Public assembly
Global assembly cache contains shared assemblies that are globally accessible to
all .net application on the machine.
Shared assembly is installed in the GAC.
Machine config sets the base configuration for all the .net assemblies running
on the server.
Web config sets the base config for all the web app and override settings in
machine configuration.
Limitation of Viewstate
Performance are affected when large values are stored because view state is
stored in the page.
Despite the state stores data in a hashed format, it can still be tampered
because it is stored in a hidden field on the page.
What is scavenging?
It is process of deleting items from the cache when memory is scarce.
Items are removed from cache depending on cache item priority.
Cache item priority is set when you add item to cache.
The items scavenging are removed according to priority.
With Single Call object, the object is stateless as object is created with every
method call.
The object is created once and the object is shared with all clients with
Singleton.
Page fragment caching involves the caching of a fragment of the page, rather
than the entire page.
When portions of the page are need to be dynamically created for each user
request this is best
method as compared to page caching. You can wrap Web Forms user control
and cache the
control so that these portions of the page do not need to be recreated each
time.
Query string data is directly visible to user thus leading to security problems.-
Most browsers and client devices impose a 255-character limit on URL length.
You specify the duration of the cache using Absolute Expiration, starting from
the time the cache is activated.
Using hidden frames you can cache more than one data field.
The ability to cache and access data items stored in different hidden forms.
Advantages of cookies
One of the biggest threat of using Hidden fields are that they can be tampered
creating a security hole.
Page performance adversely affected if you store large data since the data are
stored in pages itself.
They do not support rich structures as HTML hidden fields are only single
valued.
Also Read
ASP.NET Methodologies
ASP.NET attempts to make the web development methodology like the GUI
development methodology by allowing developers to build pages made up of
controls similar to a GUI. Server controls in ASP.NET function similarly to GUI
controls in other environments..........
The truth is that ASP.NET has several issues that need to be addressed..........
Web application exists in compiled form on the server so the execution speed is
faster as compared to the interpreted scripts.........
ASP.NET AJAX Futures Community Technology Preview (CTP) — The ASP.NET 2.0
AJAX framework contains a set of functionality that is experimental in nature.
This functionality will eventually become integrated with the RTM/Core code.
AJAX makes it possible to create better and more responsive websites and web
applications...............
Search engines may not be able to index all portions of your AJAX application
site.........
What Is ASP.NET AJAX?
ASP.NET AJAX is the name of Microsoft’s AJAX solution, and it refers to a set of
client and server technologies that focus on improving web development with
Visual Studio...............
With AJAX, much of the logic surrounding user interactions can be moved to the
client. This presents its own set of challenges. Some examples of AJAX use
include streaming large datasets to the browser that are managed entirely in
JavaScript..................
Anonymous types defined with var are not VB variants. The var keyword signals
the compiler to emit a strong type based on the value of the operator on the
right side. Anonymous types can be used to initialize simple types like integers
and strings but detract modestly from clarity and add little value..............
We will learn about MVC design patterns, and how Microsoft has made our lives
easier by creating the ASP.NET MVC framework for easier adoption of MVC
patterns in our web applications...............
MVC Design
MVC, which stands for Model View Controller, is a design pattern that helps us
achieve the decoupling of data access and business logic from the presentation
code , and also gives us the opportunity to unit test the GUI effectively and neatly,
without worrying about GUI changes at all..........
aspnet2008.blogs w w w .google.co.
SharePoint Portal Server is a portal server that connects people, teams, and
knowledge across business processes. SharePoint Portal Server integrates
information from various systems into one secure solution through single sign-on
and enterprise application integration capabilities. It provides flexible deployment
and management tools, and facilitates end-to-end collaboration through data
aggregation, organization, and searching. SharePoint Portal Server also enables
users to quickly find relevant information through customization and
personalization of portal content and layout as well as through audience
targeting.
Windows SharePoint Services is the solution that enables you to create Web sites
for information sharing and document collaboration. Windows SharePoint
Services " a key piece of the information worker infrastructure delivered in
Microsoft Windows Server 2003 " provides additional functionality to the
Microsoft Office system and other desktop applications, and it serves as a
platform for application development.
Office SharePoint Server 2007 builds on top of Windows SharePoint Services 3.0
to provide additional capabilities including collaboration, portal, search,
enterprise content management, business process and forms, and business
intelligence.
What is JQuery
JQuery is a light weight JavaScript library which provides fast and easy way of
HTML DOM traversing and manipulation, its event handling, its client side
animations, etc. One of the greatest features of jQuery is that jQuery supports an
efficient way to implement AJAX applications because of its light weight nature
and make normalize and efficient web programs.
Dot Net CLR and all .net realtes application and Sql Server run in same process or
we can say that that on the same address because there is no issue of speed
because if these two process are run in different process then there may be a
speed issue created one process goes fast and other slow may create the
problem.
(1)Presentation
(2)Business Logic
(3)Database
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->
(1)First layer Presentation contains mainly the interface code, and this is shown
to user. This code could contain any technology that can be used on the client
side like HTML, JavaScript or VBScript etc.
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->
(2)Second layer is Business Logic which contains all the code of the server-side
.This layer have code to interact with database and to query, manipulate, pass
data to user interface and handle any input from the UI as well.
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->
(3)Third layer Data represents the data store like MS Access, SQL Server, an XML
file, an Excel file or even a text file containing data also some additional database
are also added to that layers.
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->
When not to use Design Patterns
• When the software being designed would not change with time.
• When the requirements of the source code of the application are unique.
If any of the above applies in the current software design, there is no need to
apply design patterns in the current design and increase unnecessary complexity
in the design.