Archive for 2017
C#.NET Interview Questions and Answers
1. What is C#.NET?
Ans: C#.NET is an object oriented programming language used as code behind language to create .NET applications.2. What is namespace?
Ans: .NET Framework uses namespaces to organize its many classes, as follows: System.Console.WriteLine("Hello World!");System is a namespace and Console is a class in that namespace.
Namespaces are declared at the top of every program as shown below to use classes inside it in the program.
Example: using System;
3. What is the base class for all .NET datatypes?
Ans: The Object Type is the ultimate base class for all data types in C# Common Type System (CTS). Object is an alias for System.Object class. The object types can be assigned values of any other types, value types, reference types, predefined or user-defined types. However, before assigning values, it needs type conversion.
4. What is Boxing in C#.NET?
Ans: When a value type is converted to object type, it is called boxing.5. What is UnBoxing in C#.NET?
Ans: When an object type is converted to a value type, it is called unboxing.6. What are pointer types in C#?
Ans: Pointer type variables store the memory address of another type. Pointers in C# have the same capabilities as the pointers in C or C++.Syntax for declaring a pointer type is −type* identifier;
For example:
char* cptr;
int* iptr;
7. What is encapsulation?
Ans: Encapsulation is defined 'as the process of enclosing one or more items within a physical or logical package'. Encapsulation, in object oriented programming methodology, prevents access to implementation details.8. C#.NET Access specifiers?
Ans: Access specifiers are used to define scope of a type as well as its members ie.,who can access it and who can't access it.
C#.NET supports five different access specifiers. They are:1)Private
2)Public
3)Protected
4)Internal
5)Protected Internal
Default access specifier of method is private.
Default access specifier of class is internal.
Private:Members declared as private cannot be accessed outside the block.
Members declared as private within class or structure aren't possible outside of them in which they are defined.
In C# the default scope for members of a class or structure is "Private".
Public:
Members declared as public can be accessed from anywhere.
Protected:
Members declared as protected can be accessed only in the inherited classes
Internal:
Members declare as internal can be used only with in the project.
Members which are declared as internal were accessible only with in the project both from child or non-child classes.
The default scope for class is Internal.
Protected Internal:
Members declared as Protected Internal, enjoy dual scope ie., Internal and Protected.
Within the project they behave as internal, providing access to all other classes.
Outside the project they behave as Protected, and still provide access to child classes
3 layer architecture
Create website- ASP Project
Create class library - BAL
Create class library - DAL
Add references as below:
BAL in ASP Project
DAL in BAL
Adding class:
Right click on dal project
add class with name as DUser.cs
Make class as public bcoz it is used in other project.
To use some namespaces you have to add reference in DAL project
Right click on DAL Project
Add references
In assemblies/.NET add System.Configuration to use ConfigurationManager class in DAL layer.
Create DUser class - Write method with parameters and ADO.NET Code.
Right click on BAL Project
Add BUser class - Write method with parameters and C# logic
Sending inputs:
PL - input parameter (txt.text) - > BAL - input parameter (variables) -> DAL
Returning values:
DAL - return value -> BAL - return value -> PL
Calling methods:
Call methods of BAL from Presentation layer.
Call methods of DAL from BAL.
Developer Unit Testing
Unit testing is done by the developer to check your code is working as expected or not.
It is called unit testing as the developed functionality is tested individuals as small units.
Visual Studio Test Explorer is used to find the list of unit test methods available in the project and provides options to run/debug your unit tests.
It improves the quality of the code as it is easy to test every unit of program using automated unit testing as soon as new code is added into the project.
With Test driven development by proper unit testing bugs in the code can be reduced.
You can also install add ons of other 3rd party unit testing tools in Visual Studio to use them for unit testing.
Code Example:
In the below example Unit Test project is created.
In test class(UnitTest1) two test methods are created 1. TestAuthSignInSuccess and 2. TestAuthSignInFail methods.
Original method(DUserAuth) used for user registration which has to be tested is also written in the same class.
--------------
It is called unit testing as the developed functionality is tested individuals as small units.
Visual Studio Test Explorer is used to find the list of unit test methods available in the project and provides options to run/debug your unit tests.
It improves the quality of the code as it is easy to test every unit of program using automated unit testing as soon as new code is added into the project.
With Test driven development by proper unit testing bugs in the code can be reduced.
You can also install add ons of other 3rd party unit testing tools in Visual Studio to use them for unit testing.
Code Example:
In the below example Unit Test project is created.
In test class(UnitTest1) two test methods are created 1. TestAuthSignInSuccess and 2. TestAuthSignInFail methods.
Original method(DUserAuth) used for user registration which has to be tested is also written in the same class.
--------------
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Data.SqlClient; using System.Data; namespace UTDigitalWorkSpace { [TestClass] public class UnitTest1 { [TestMethod] public void TestAuthSignInSuccess() { //inputs string username = "ravi"; string password = "ravi123"; //outputs UnitTest1 ut = new UnitTest1(); int result = ut.DUserAuth(username, password); //expected outputs int expectedResult = 1; //check Assert.AreEqual(result, expectedResult); } [TestMethod] public void TestAuthSignInFail() { //inputs string username = "ravi"; string password = "ravi12344"; //outputs UnitTest1 ut = new UnitTest1(); int result = ut.DUserAuth(username, password); //expected outputs int expectedResult = 0; //check Assert.AreEqual(result, expectedResult); } public int DUserAuth(string UserName, string Password) { SqlConnection con1 = new SqlConnection(@"Data Source=.;Initial Catalog=DigitalWorkSpace;Integrated Security=True"); SqlCommand cmd = new SqlCommand("select * from Tbl_SignUp where UserName='" + UserName + "'and password='" + Password + "'and Status='A'", con1); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); return ds.Tables[0].Rows.Count; } } }
Interview Questions
Fresher:
Add your strengths at the top of the resume. Try you add your extra curricular activities and awards information along with academic achievements.
If your academic records are not good then add your technical skills above your academic information.
Your interests and hobbies related to technology on the resume grabs more attraction.
Experienced:
1. Difference between the versions of tools you used in your projects?
If you mention about the usage of more than one version of the same tool in your projects then you have to be ready with the knowledge of
- differences between the versions
- updates in the new version
- how the new updates are used in your project
2. What is the module you worked in your project?
You should have knowledge on the entire project and how it works but you have the scope to work on limited modules. So, you have to explain in detail about how that module works and how it is implemented.
3. What are the challenges you faced in implementing that module and how you resolved it?
While implementing a project as a team you will run into some difficulties when you go through some tricky scenarios. You have to explain about your contribution to your team to resolve them.
Example: Task: To print data of a registered user in pdf format. Answer: Printing a pdf file is easy but converting data available in database table to pdf format to print is difficult. External tools to do this required license which is costly. In that time i converted the data into html page and then used it to print which resolved this issue.
4. What are your responsibilities in your project?
My responsibilities in my project is to understand the requirements, analyzing the requirements to find the technical solutions to it and implement it with good quality.
5. Explain about your project architecture?
I used ASP.NET 3 tier architecture in my 1 st project and used MVC architecture in the 2 nd project.
Explain about 3 tier and MVC with uses.
6. What is the duration of your 2 nd project?
7. What are the functionalities you are providing to the customer in 2 nd project?
8. What are the .NET features used in current project?
OOPs concepts, interfaces, exception handling...
9. Explain about SDLC?
Agile methodology and scrum framework
10. How many members are there in your team and what is the process you followed?
Add your strengths at the top of the resume. Try you add your extra curricular activities and awards information along with academic achievements.
If your academic records are not good then add your technical skills above your academic information.
Your interests and hobbies related to technology on the resume grabs more attraction.
Experienced:
1. Difference between the versions of tools you used in your projects?
If you mention about the usage of more than one version of the same tool in your projects then you have to be ready with the knowledge of
- differences between the versions
- updates in the new version
- how the new updates are used in your project
2. What is the module you worked in your project?
You should have knowledge on the entire project and how it works but you have the scope to work on limited modules. So, you have to explain in detail about how that module works and how it is implemented.
3. What are the challenges you faced in implementing that module and how you resolved it?
While implementing a project as a team you will run into some difficulties when you go through some tricky scenarios. You have to explain about your contribution to your team to resolve them.
Example: Task: To print data of a registered user in pdf format. Answer: Printing a pdf file is easy but converting data available in database table to pdf format to print is difficult. External tools to do this required license which is costly. In that time i converted the data into html page and then used it to print which resolved this issue.
4. What are your responsibilities in your project?
My responsibilities in my project is to understand the requirements, analyzing the requirements to find the technical solutions to it and implement it with good quality.
5. Explain about your project architecture?
I used ASP.NET 3 tier architecture in my 1 st project and used MVC architecture in the 2 nd project.
Explain about 3 tier and MVC with uses.
6. What is the duration of your 2 nd project?
7. What are the functionalities you are providing to the customer in 2 nd project?
8. What are the .NET features used in current project?
OOPs concepts, interfaces, exception handling...
9. Explain about SDLC?
Agile methodology and scrum framework
10. How many members are there in your team and what is the process you followed?
About AngularJS
AngularJs is a JavaScript framework used to build web applications. It is a free source developed by Google.
Advantages:
Dependency injection
Two way data binding
Supports clean MVC architecture
Controlling DOM.
http://angularjs.org/ - Link to download AngularJs library.
Example:
In html page with ref of angularjs file with below code it will display 30 on browser.
<!DOCTYPE html>
<html>
<head>
<script src="Script/angular.min.js"></script>
</head>
<body ng-app>
{{10+20}}
</body>
</html>
Advantages:
Dependency injection
Two way data binding
Supports clean MVC architecture
Controlling DOM.
http://angularjs.org/ - Link to download AngularJs library.
Example:
In html page with ref of angularjs file with below code it will display 30 on browser.
<!DOCTYPE html>
<html>
<head>
<script src="Script/angular.min.js"></script>
</head>
<body ng-app>
{{10+20}}
</body>
</html>
Module
A module is a container of different parts of the application.
A module is a container of different parts of the application.
ASP.NET Displaying Online Users Count and Page Views - Application state in Global.asax
ASP Source code:
<p>
Online User:
<asp:Label ID="lblOnline" runat="server" Text="0"></asp:Label>
</p>
<p>
Page Views:
<asp:Label ID="lblPageViews" runat="server" Text="0"></asp:Label>
</p>
ASP C#.NET Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace StarBus
{
public partial class _default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//increment on page load and display
Application["PageViews"] = Convert.ToInt32(Application["PageViews"]) + 1;
lblPageViews.Text = Application["PageViews"].ToString();
//display online users
lblOnline.Text = Application["OnlineUsers"].ToString();
}
}
}
Global.asax file:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
namespace StarBus
{
public class Global : System.Web.HttpApplication
{
protected void Application_BeginRequest(object sender, EventArgs e)
{
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
}
protected void Application_Error(object sender, EventArgs e)
{
}
protected void Application_Start(object sender, EventArgs e)
{
Application["OnlineUsers"] = 0;
Application["PageViews"] = 0;
}
protected void Session_Start(object sender, EventArgs e)
{
Application["OnlineUsers"] = Convert.ToInt32(Application["OnlineUsers"]) + 1;
}
protected void Session_End(object sender, EventArgs e)
{
Application["OnlineUsers"] = Convert.ToInt32(Application["OnlineUsers"]) - 1;
}
protected void Application_End(object sender, EventArgs e)
{
}
}
}
<p>
Online User:
<asp:Label ID="lblOnline" runat="server" Text="0"></asp:Label>
</p>
<p>
Page Views:
<asp:Label ID="lblPageViews" runat="server" Text="0"></asp:Label>
</p>
ASP C#.NET Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace StarBus
{
public partial class _default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//increment on page load and display
Application["PageViews"] = Convert.ToInt32(Application["PageViews"]) + 1;
lblPageViews.Text = Application["PageViews"].ToString();
//display online users
lblOnline.Text = Application["OnlineUsers"].ToString();
}
}
}
Global.asax file:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
namespace StarBus
{
public class Global : System.Web.HttpApplication
{
protected void Application_BeginRequest(object sender, EventArgs e)
{
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
}
protected void Application_Error(object sender, EventArgs e)
{
}
protected void Application_Start(object sender, EventArgs e)
{
Application["OnlineUsers"] = 0;
Application["PageViews"] = 0;
}
protected void Session_Start(object sender, EventArgs e)
{
Application["OnlineUsers"] = Convert.ToInt32(Application["OnlineUsers"]) + 1;
}
protected void Session_End(object sender, EventArgs e)
{
Application["OnlineUsers"] = Convert.ToInt32(Application["OnlineUsers"]) - 1;
}
protected void Application_End(object sender, EventArgs e)
{
}
}
}
web.config - connection string
web.config
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<connectionStrings>
<add name="BiggerrConnection" connectionString="Data Source=ADMIN\MSSQLSERVERNEW;Initial Catalog=Biggerr;Integrated Security=True;" />
</connectionStrings>
ADO.NET DropDownlist binding
SQL Queries
create Table Tbl_Category (CategoryId bigint Primary key identity, CategoryName varchar(100),CreatedTime datetime)
insert Tbl_Category values('Electronics',getdate())
insert Tbl_Category values('Home Appliances',getdate())
insert Tbl_Category values('Books',getdate())
insert Tbl_Category values('Fashion and Life Style',getdate())
select * from Tbl_Category
create Table Tbl_SubCategory (SubcategoryId bigint Primary key identity,SubCatCategoryId bigint foreign key references Tbl_Category(CategoryId),
SubcategoryName varchar(100),createdtime datetime)
insert Tbl_SubCategory values ('1','Air Conditioners',getdate())
insert Tbl_SubCategory values ('1','LEDs',getdate())
insert Tbl_SubCategory values ('1','Mobiles',getdate())
insert Tbl_SubCategory values ('1','Others',getdate())
insert Tbl_SubCategory values ('2','Mixer',getdate())
insert Tbl_SubCategory values ('2','Grinder',getdate())
insert Tbl_SubCategory values ('2','Microwave',getdate())
insert Tbl_SubCategory values ('2','Fridge',getdate())
select * from Tbl_SubCategory
ASP.NET Source Code
<asp:DropDownList ID="DDLCatagories" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DDLCatagories_SelectedIndexChanged">
</asp:DropDownList>
<asp:DropDownList ID="DDLSubCatagories" runat="server">
</asp:DropDownList>
ASP.NET C# Code
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace BIGGERR.Customer
{
public partial class CustomerProducts : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DisplayCategory();
}
}
public void DisplayCategory()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["BiggerrConnection"].ConnectionString);
string s = "select * from Tbl_Category";
SqlCommand cmd = new SqlCommand(s, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
DDLCatagories.DataSource = ds;
DDLCatagories.DataValueField = "CategoryId";
DDLCatagories.DataTextField = "CategoryName";
DDLCatagories.DataBind();
}
protected void DDLCatagories_SelectedIndexChanged(object sender, EventArgs e)
{
DisplaySubCategory();
}
public void DisplaySubCategory()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["BiggerrConnection"].ConnectionString);
string s = "select * from Tbl_SubCategory where SubCatCategoryId="+DDLCatagories.SelectedValue;
SqlCommand cmd = new SqlCommand(s, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
DDLSubCatagories.DataSource = ds;
DDLSubCatagories.DataValueField = "SubcategoryId";
DDLSubCatagories.DataTextField = "SubcategoryName";
DDLSubCatagories.DataBind();
}
}
}
web.config
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<connectionStrings>
<add name="BiggerrConnection" connectionString="Data Source=ADMIN\MSSQLSERVERNEW;Initial Catalog=Biggerr;Integrated Security=True;" />
</connectionStrings>
</configuration>
GridView Edit Update Delete
SQL Queries
create table Tbl_Admin(Aid int identity primary key, Username varchar(50),Pwd varchar(50),PhoneNumber varchar(20),createdtime datetime)
insert into Tbl_Admin values('sudhir','sud',999898898,getdate())
insert into Tbl_Admin values('raj','raj123',999898897,getdate())
insert into Tbl_Admin values('gopal','gopal123',999898896,getdate())
insert into Tbl_Admin values('sai','sai123',999898895,getdate())
select * from Tbl_Admin
ASP.NET Source Code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication3.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Aid"
AutoGenerateDeleteButton="True" AutoGenerateEditButton="True"
onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing"
onrowupdating="GridView1_RowUpdating">
<Columns>
<asp:BoundField DataField="Aid" HeaderText="Aid" />
<asp:BoundField DataField="Username" HeaderText="Username" />
<asp:BoundField DataField="Pwd" HeaderText="Password" />
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
ASP.NET Source Code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication3.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Aid"
AutoGenerateDeleteButton="True" AutoGenerateEditButton="True"
onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing"
onrowupdating="GridView1_RowUpdating">
<Columns>
<asp:BoundField DataField="Aid" HeaderText="Aid" />
<asp:BoundField DataField="Username" HeaderText="Username" />
<asp:BoundField DataField="Pwd" HeaderText="Password" />
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
C#.NET Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
namespace WebApplication3
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//only for first time
GridFill();
}
}
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=JobPortal;Integrated Security=True");
public void GridFill()
{
//GridView Fill
SqlCommand cmd = new SqlCommand("select * from Tbl_Admin", con);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
}
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
// GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex];
// Label lbldeleteid = (Label)row.FindControl("lblID");
con.Open();
SqlCommand cmd = new SqlCommand("delete FROM tbl_admin where aid='" + Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString()) + "'", con);
cmd.ExecuteNonQuery();
con.Close();
GridFill();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
GridFill();
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int aid = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex];
// Label lblID = (Label)row.FindControl("lblID");
//TextBox txtname=(TextBox)gr.cell[].control[];
TextBox textName = (TextBox)row.Cells[2].Controls[0];
TextBox textpwd = (TextBox)row.Cells[3].Controls[0];
//to convert textboxes to labels in gridview
GridView1.EditIndex = -1;
con.Open();
SqlCommand cmd = new SqlCommand("update tbl_admin set username='" + textName.Text + "',pwd='" + textpwd.Text + "' where aid='" + aid + "'", con);
cmd.ExecuteNonQuery();
con.Close();
GridFill();
}
}
}
ASP.NET State Management Techniques
State management Techniques
Every click on website will load some data in web page.Every time that data will come from server
To save state for every request we use state management techniques.
google login - inbox - sent items(it will remember u)
There are two types of state management techniques. They are client side state management techniques and server side state management techniques.
Client Side State Management Techniques
View State (Same page)
Example: page with lot of fields are filled and refreshed but data is not lost (Page)
Code Example:create asp web form
add html textbox, asp text box and button
you can see on button click html textbox data will be lost but not for asp textbox because it has inbuilt viewstate.
viewstate data is stored behind the page which can be seen by seeing view page source.
Querystring (Next page)
Passing data from one page to other through url.http://google.com?a=12
you selected an item on first page, that value is sent to next page through url.
Example:
protected void Button2_Click(object sender, EventArgs e)
{
//sending value in a text box to next page through url
Response.Redirect("Default2.aspx?a=" + TextBox2.Text);
}
http://localhost:50158/Default2.aspx?a=abc
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(Request["a"]);
}
Cookies (Multiple pages)
Data is stored in system or browser.Example: remember pwd
Hidden field (same page)
a control that is not visible but can store some data.
Server Side State Management Techniques
Session (Multiple page)
It will have the lifetime of the user.From login to logout.
data is saved on the server.
Application State (Multiple page)
Stored a value which has lifetime of an application.data is stored on the server.
Example: pageview in a blog
To count page views of a page:
protected void Page_Load(object sender, EventArgs e)
{
if (Application["PageViews"] == null)
{ Application["PageViews"] = 0; }
else
{
Application["PageViews"] = ((int)Application["PageViews"]) + 1;
Response.Write(Application["PageViews"].ToString());
}
}