Beruflich Dokumente
Kultur Dokumente
• Every time an Internet user visits a specific Web site, a new session ID is
assigned. Closing a browser and then reopening and visiting the site again
generates a new session ID.
What is Cookies?
Cookies are small pieces of information stored in the client computer.
They are limited to 4K in size.
Cookies are two types:
1. In-memory cookies also called as Session cookies or Non-Persistent cookies
These cookies are saved in memory and will be lost while closing your browser.
2. Persistent cookies
A persistent cookie is saved as a text file in the file system of the client
computer usually under Temporary Internet Files folder. To create persistent
cookie we need to set cookie Expires property. Generally we go for persistent
cookies to implement the features like “Remember me” option OR to store user
information such as selected theme.
Example 1:
Example 2:
Response.Cookies["userName"].Value = "Annathurai";
Response.Cookies["userColor"].Value = "Black";
What is IIS?
Internet Information Services is used to make your computer a web server.
If we want to have a web server for developing dynamic website or want to
publish website on our own server then we install the IIS. IIS is used on windows
plate form. For other plate form we have different web servers. E.g. apache for
Linux.
What are the differences between User Controls and Custom Controls?
1. User Controls are easy to create where as Custom Controls are difficult to
create.
2. User Controls cannot be compiled into an assembly; where as Custom
Controls can be compiled into an assembly.
3. User Controls cannot be added to tool box; where as Custom controls can be
added to the toolbox.
4. You need to have a copy of user control in every project where you want to
use it, where as this is not the case with custom controls. You can install a single
copy of the Web custom control in the global assembly cache and share it
between applications, which make maintenance easier.
5. User controls are used for reusing existing user interface elements and code,
but are not useful for developing reusable components for multiple web
applications.
What is Page Rendering?
Page rendering is the process of generating a page from the database.
Use the Page Rendering section to modify controls that impact the rendering of a
page, including page attributes, regions, buttons, items, page rendering
computations, and page processes.
This class works only when your This class works only when your
application build defines the symbol application build defines the symbol
TRACE. DEBUG.
For tracing, you have to use For tracing, you have to use
Trace.WriteLine statements. Debug.WriteLine statements.
Trace class is generally used to trace the You generally use debug classes at
execution during deployment of the the time of development of
application. application.
Trace class works in both debug mode Debug class works only in debug
as well as release mode. mode.
Trace runs in a thread that is different Debug runs in the same thread in
from the Main Thread. which your code executes.
Trace is used during Testing Phase and Debug is used during Debugging
Optimization Phase of different releases. Phase
What is Tracing?
Tracing is a way to monitor the execution of your ASP.NET application. You
can record exception details and program flow in a way that doesn't affect the
program's output.
Page level Tracing
Additionally, you can add the TraceMode attribute that sets SortByCategory or
the default, SortByTime. You can use SortByTime to see the methods that take
up the most CPU time for your application. You can enable tracing
programmatically using the Trace.IsEnabled property.
Application Tracing
You can enable tracing for the entire application by adding tracing settings in
web.config. In below example, pageOutput="false" and requestLimit="20" are
used, so trace information is stored for 20 requests, but not displayed on the
page because pageOutput attribute is set to false.
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="false" />
<authentication mode="Windows" />
<trace enabled ="true" pageOutput ="false" requestLimit ="20"
traceMode ="SortByTime " />
</system.web>
</configuration>
The page-level settings take precedence over settings in Web.config, so if
enabled="false" is set in Web.config but trace="true" is set on the page, tracing
occurs.
Trace.Write(String Category,String Message, Exception errorinfo);
Trace.Warn(String Category,String Message, Exception errorinfo);
Data View:
The Data filtration in dataset can be done using data view.
//
DataView dv = new DataView(ds.Tables[0], "CategoryID > '2'", "CategoryID",
DataViewRowState.CurrentRows);
You can use the FormView control to do anything that you can do with the
DetailsView control. Just as you can with the DetailsView control, you can use the
FormView control to display, page, edit, insert, and delete database records.
However, unlike the DetailsView control, the FormView control is entirely
template driven
The FormView control provides you with more control over the layout of a form.
Furthermore, adding validation controls to a FormView is easier than adding
validation controls to a DetailsView control.
Details View Form View
Both the Repeater and Data List controls helps us to display a set of data
items at a time. For example, you can use these controls to display all the rows
contained in a database table.
The Repeater control is entirely template driven. You can format the rendered
output of the control in any way that you please. For example, you can use the
Repeater control to display records in a bulleted list, a set of HTML tables, or
even in a comma-delimited list.
The DataList control is also template driven. However, unlike the Repeater
control, the default behavior of the DataList control is to render its contents into
an HTML table. The DataList control renders each record from its data source
into a separate HTML table cell.
The Repeater control provides you with the maximum amount of flexibility in
rendering a set of database records. You can format the output of the Repeater
control in any way that you please.
The DataList control, like the Repeater control, is template driven. Unlike the
Repeater control, by default, the DataList renders an HTML table. Because the
DataList uses a particular layout to render its content, you are provided with
more formatting options when using the DataList control.
What is a Gridview?
The Gridview Web server control is a powerful tool for displaying
information from a data source. It is easy to use; you can display editable data in
a professional-looking grid by setting only a few properties. At the same time,
the grid has a sophisticated object model that provides you with great flexibility
in how you display the data.