Client Side programming in ASP.Net:
ASP.Net client side coding has two steps:
- Client side scripts: that could execute on the browser and in turn would speed up the running of page. For example, client side data validation which may catch invalid data and message the user accordingly without creating a round trip to the server.
- Client side source code: that the ASP.NET pages provides. For example, the HTML source code of an ASP.NET page has a number of related fields and automatically injected blocks of JavaScript code, which saves information like view state or does other jobs to create the page work.
Client Side Scripts:
All ASP.Net server controls gives calling client side code written using JavaScript or VBScript. Some ASP.Net server controls use client side scripting to give responses to the users without operating back to the server, for example, the validation controls, which we will defines in due time.
Apart from these scripts the control has a property OnClientClick, which allows running client-side script, when the button is pressed.
The server and traditional HTML controls has the given events that will run a script when they are raised:
Event
|
Description
|
onblur
|
When the control loses focus on page
|
onfocus
|
When the control receives focuson page
|
onclick
|
When the control is pressed
|
onchange
|
When the value of the control modifies
|
onkeydown
|
When the user click a key
|
onkeypress
|
When the user clicks an alphanumeric key
|
onkeyup
|
When the user free a key
|
onmouseover
|
When the user takes the mouse pointer over the control
|
onserverclick
|
It increases the ServerClick event of the control, when the control is clicked
|
Client Side Source Code
We have already illustrated that, ASP.NET pages are usually written in two files:
- The content file or the markup file ( .aspx)
- The code-behind file
The content file has the HTML or ASP.Net literals and controls tags to form the procedure of the page and the code related file contains the class definition. At execution time, the content file is transformed and parsed into a page class.
This class related with the class definition in the code part and some another system given code create the ruunable code (assembly) that functions all posted data and prepares the response and transmits it back to the client.
Take the simple page:
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="Default.aspx.cs"
Inherits="clientside._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server"
OnClick="Button1_Click" Text="Click" />
</div>
<hr />
<h3><asp:Label ID="Msg" runat="server" Text=""></asp:Label>
</h3>
</form>
</body>
</html>
|
When this page is execute on the browser, the View Source option indicates the HTML page sent to the browser by the ASP.Net runtime:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" >
<head><title>
Untitled Page
</title></head>
<body>
<form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwUKMTU5MTA2ODYwOWRk31NudGDgvhhA7joJum9Qn5RxU2M=" />
</div>
<div>
<input type="hidden" name="__EVENTVALIDATION"
id="__EVENTVALIDATION"
value="/wEWAwKpjZj0DALs0bLrBgKM54rGBhHsyM61rraxE+KnBTCS8cd1QDJ/"/>
</div>
<div>
<input name="TextBox1" type="text" id="TextBox1" />
<input type="submit" name="Button1" value="Click" id="Button1" />
</div>
<hr />
<h3><span id="Msg"></span></h3>
</form>
</body>
</html>
|
Looking closely at the program would reveal that first two <div> tags have the hidden fields which store the validation information and view state.
Email based ASP.Net assignment help - homework help at Expertsmind
Are you searching ASP.Net expert for help with Client Side programming in ASP.Net questions? Client Side programming in ASP.Net topic is not easier to learn without external help? We at www.expertsmind.com offer finest service of ASP.Net assignment help and ASP.Net homework help. Live tutors are available for 24x7 hours helping students in their Client Side programming in ASP.Net related problems. Computer science programming assignments help making life easy for students. We provide step by step Client Side programming in ASP.Net question's answers with 100% plagiarism free content. We prepare quality content and notes for Client Side programming in ASP.Net topic under ASP.Net theory and study material. These are avail for subscribed users and they can get advantages anytime.
Why Expertsmind for assignment help
- Higher degree holder and experienced experts network
- Punctuality and responsibility of work
- Quality solution with 100% plagiarism free answers
- Time on Delivery
- Privacy of information and details
- Excellence in solving ASP.Net queries in excels and word format.
- Best tutoring assistance 24x7 hours