Beruflich Dokumente
Kultur Dokumente
4.
Browser Capability
5.
First Program
1. Open new ASP.NET Web Site then click
OK.
4.
5. 2. Open Tool Box and drag ScriptManager and
UpdatePanel from AJAX Extensions. Then drag
label and Button, named UsingAjax. Open
properties window of UpdatePanel. Go to
Triggers property and click on collection then
add the controlID (Button name, which you
6.
7.
8. 3. Paste the code in .cs file of the
application
protected void with_ajax_Click1(object sender,
EventArgs e)
{
Label1.Text = DateTime.Now.ToString();
}
protected void without_ajax_Click(object sender,
EventArgs e)
{
Label2.Text = DateTime.Now.ToString();
}
10.
11.
Clicking on "Using Ajax Button" ,only
first time (label) will be updated without
reloading whole page.
12.
Clicking on "Without Ajax Button", whole
page Reloaded.
Ajax Controls
You drop the controls to your page (Default.aspx)
from the Tab Ajax Extensions.
1. ScriptManager Control
Client script for AJAX-enable ASP.NET Web pages
managed by ScriptManager control . ScriptManager
control registered the client script for the Microsoft
Ajax Library with the page. Script manager support
features such as
1.
2.
Web-service calls.
2. ScriptManagerProxy Control
When a ScriptManager control is already defined in
a parent element (or master page or host page
already contains a ScriptManager control) then
used ScriptManagerProxy control to enables nested
components and user control to add service and
script.
3. Timer control
The ASP.NET AJAX Timer control
1.
4.
5.
4. UpdatePanel control
Which area on web page you want to partial
update, used under the UpdatePanel control. Don't
wrap your entire page within an UpdatePanel. You
may use several panels on your page. UpdatePanel
control is the most important control in the
ASP.NET AJAX package. It will AJAX controls
contained within it, allowed to partial rendering of
the area on the web page.
5. UpdateProgress Control
UpdateProgress control provides status information
about partial-page updates in UpdatePanel
controls. UpdateProgress control provides, to
customize the content. When a partial-page update
is very fast, you can specify a delay before the
UpdateProgress control is displayed.
ScriptManager Control
Client script for AJAX-enable ASP.NET Web pages
managed by ScriptManager control . ScriptManager
control registered the client script for the Microsoft
Ajax Library with the page. Script manager support
features such as
1.
2.
Web-service calls.
Timer control
The ASP. NET AJAX Timer control
1.
4.
5.
Click OK
System;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
using
System.Web.UI.HtmlControls;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.W
ebParts;
using System.Xml.Linq;
public partial class _Default :
System.Web.UI.Page
{
protected void
Page_Load(object sender,
EventArgs e)
{
}
protected void
Timer1_Tick1(object sender,
EventArgs e)
{
Label1.Text =
System.DateTime.Now.ToString
();
}
}
<asp:AsyncPostBackTrigger
ControlID="Timer1"
EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:Timer ID="Timer1"
runat="server"
ontick="Timer1_Tick1"
Interval="60">
</asp:Timer>
</form>
</body>
</html>
UpdatePanel control
Click Ok
<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<!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>Untitled Page</title>
</head>
<body>
</asp:TextBox>
</p>
<p>
<asp:Button ID="Button1"
runat="server"
style="top: 160px; left: 170px;
position: absolute; height: 26px; width:
56px"
Text="Button" />
</p>
</form>
</body>
</html>
UpdateProgress Control
UpdateProgress control provides status information
about partial-page updates in UpdatePanel
controls. UpdateProgress control provides, to
customize the content. When a partial-page update
is very fast, you can specify a delay before the
UpdateProgress control is displayed.
Example
1.Open a new Website. Add ScriptManager,
updatePanel and UpdateProgress in order.
<p> </p>
<asp:UpdateProgress
ID="UpdateProgress1" runat="server">
<ProgressTemplate><img
src="face.jpg" width="300"
height="300" /></ProgressTemplate>
</asp:UpdateProgress>
</form>
</body>
</html>
<ProgressTemplate> property used to gets or
sets the template, which defined the content
of the UpdateProgress control.
On Update Button Click (.cs Code)
protected void
update_bt_Click(object
sender, EventArgs e)
{
System.Threading.Thread.S
leep(5000);
}
4. Debug the Application
AjaxToolkitExtender Controls
1. Accordion Control
2. AlwaysVisibleControl
3. Animation Control
4. AsyncFileUpload Control
5. AutoComplete Control
6. Calendar Control
7. CascadingDropDown Control
8. TextBoxWatermark
9. HoverMenu Control
10.
ConfirmButton Control
11.
Rating Control
12.
ToggleButton Control
13.
Tabs Control
14.
Slider Control
15.
DragPanel Control
16.
DropDown Control
17.
CollapsiblePanel Control
18.
DropShadow Control
19.
FilteredTextBox Control
20.
RoundedCorners Control
21.
ResizableControl
22.
PopupControl
23.
ListSearchExtender Control
24.
MaskedEdit Control
25.
ValidatorCallout Control
26.
PasswordStrength Control
27.
SlideShow Control
28.
MutuallyExclusiveCheckBox Control
29.
NumericUpDown Control
30.
ModalPopupExtender
31.
MultiHandleSliderExtender Control
32.
33.
NoBot Control
34.
ReorderList Control
35.
AnimationExtender Control
36.
MaskedEditExtender Control
Accordion Control
Accordion control provide multiple panes, only one
of them is visible at a time another can be opened
by clicking the header. It is like having several
CollapsiblePanels. Each AccordionPane control has
a template for its Header and its Content.
Supports three AutoSize modes
1. None - The Accordion grows/shrinks without
restriction.
2. Limit - The Accordion never grows larger than
the value specified by its Height property.
3. Fill - The Accordion always stays the exact same
size as its Height property.
How to Use Accordion Control
Step 1. Drag Accordion Control from Ajax
Control tab. Add Pane property and
AccordionPane Control to this control (your
no of choice).
<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<%@ Register
Assembly="AjaxControlToolkit"
Namespace="AjaxControlToolkit"
TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xht
ml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
>
<head runat="server">
<title>Accordion Control</title>
</head>
<body>
<form id="Accordion Control"
runat="server">
<div>
<asp:ScriptManager
ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<cc1:Accordion ID="Accordion1"
runat="server" AutoSize="None"
FadeTransitions="true"
TransitionDuration="250"
FramesPerSecond="40"
RequireOpenedPane="false"
SuppressHeaderPostbacks="true"
BorderStyle="Solid" BorderColor="Black"
Width="300">
<Panes>
<cc1:AccordionPane
ID="AccordionPane1" runat="server"
BorderStyle="Solid">
<Header><h3>Er.Anil</h3></Header>
<Content>Anil is a Good
Programmer.....</Content>
</cc1:AccordionPane>
<cc1:AccordionPane
ID="AccordionPane2" runat="server"
BorderStyle="Solid">
<Header><h3>Er.
Ashish</h3></Header>
<Content>Ashish is a...</Content>
</cc1:AccordionPane>
<cc1:AccordionPane
ID="AccordionPane3" runat="server"
BorderStyle="Solid">
<Header><h3>Er.
Kamal</h3></Header>
<Content>Kamal is
a......</Content>
</cc1:AccordionPane>
</Panes>
</cc1:Accordion>
</form>
</body>
</html>
Step 2. Debug the application. By default first
Header opened.
Clicking on Ashish
Clicking on Kamal
AlwaysVisibleControl
To display the control above all the page content
that always visible use AlwaysVisible Control,
whether you scroll the page upwards or
downwards.
AlwaysVisible Control Properties
1. TargetControlID: ID of control for this
extender to always make visible.
2. HorizontalOffset: Default is 0 pixels, distance
to the HorizontalSide edge of the browser in pixels.
3. HorizontalSide: Default is Left, horizontal edge
of the browser (either Left, Center, or Right) used
to anchor the target control.
4. VerticalOffset: Default is 0 pixels, distance to
the VerticalSide edge of the browser to the target
control from the same side.
5. VerticalSide: Default is Top, vertical edge of
the browser (either Top, Middle, or Bottom) to the
target control.
OnHoverOut
TargetControlID
3.
OnMouseOver
4.
OnClick
5.
OnHoverOver
6.
OnMouseOut
7.
OnLoad
AsyncFileUpload Control
AsyncFileUpload Control is an ASP.NET AJAX
Control. To asynchronously upload files to the
server you can used this control.. Uploading file
results be checked on both sides (Client side and
server side). SaveAs() is calling for to save the
uploading file.
Events
1.
2.
UploadedComplete
UploadedFileError
Properties
1.
2.
CompleteBackColor
ContentType
3.
ErrorBackColor
4.
FileContent
5.
FileName
6.
HasFile
7.
OnClientUploadComplete
8.
OnClientUploadError
9.
OnClientUploadStarted
10.
PostedFile
11.
ThrobberID
12.
UploaderStyle
13.
UploadingBackColor
14.
Width
Methods
1.
SaveAs(string filename)
AutoComplete Control
AutoComplete Control is offer to suggestion for
the user and it can be attached to any TextBox
Control, associate that control with a popup panel
to display words that begin with the prefix typed
into the textbox. Dropdown lists of candidate
words is positioned on the bottom left of the text
box supplied by a web service.
AutoComplete Properties
TargetControlID
ServiceMethod
ServicePath
ContextKey
UseContextKey
MinimumPrefixLength
CompletionInterval
EnableCaching
CompletionSetCount
CompletionListCssClass
CompletionListItemCssClass.
CompletionListHighlightedItemCssClass
DelimiterCharacters
FirstRowSelected
ShowOnlyCurrentWordInCompletionListItem
Animations
<html
xmlns="http://www.w3.org/1999/xht
ml">
<head runat="server">
<title>AutoComplete</title>
</head>
<body>
<form id="AutoComplete"
runat="server">
<div>
</div>
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
<asp:TextBox ID="TextBox1"
runat="server"
style="top: 118px; left: 10px;
position: absolute; height: 22px;
width:
128px"></asp:TextBox>
<cc1:AutoCompleteExtender
ID="TextBox1_AutoCompleteExtende
r" runat="server"
TargetControlID="TextBox1"
ServiceMethod="GetCompletionList"
ServicePath="ToolkitTestService.asm
x"
MinimumPrefixLength="2"
CompletionInterval="1000"
EnableCaching="true"
CompletionSetCount="20" >
</cc1:AutoCompleteExtender>
</form>
</body>
</html>
1. Used Property and set the path of Web Service
File (ServicePath="ToolkitTestService.asmx").
2. (MinimumPrefixLength="2" ) Set this property
2, means the suggestion window will open after
entered two character
3. (CompletionSetCount="20") This property will
set the no of suggestion showen in window.
Step 4. Debug the Application and enter
character in TextBox. New suggestion
window opened.
Calendar Control
Calendar Control is an ASP.NET AJAX extender
control, provides client-side date-picking
functionality with customizable date format, that
can be attached to any ASP.NET TextBox control.
The left and right arrows can be used to move
forward or back a month to months in the current
year.
Properties
1.
2.
TargetControlID
CssClass
3.
Format
4.
PopupButtonID
5.
PopupPosition
6.
SelectedDate
ajax__calendar_container
.ajax__calendar_header
3.
.ajax__calendar_prev
4.
.ajax__calendar_title
5.
.ajax__calendar_next
6.
.ajax__calendar_body
7.
.ajax__calendar_days
8.
.ajax__calendar_dayname
9.
.ajax__calendar_day
10.
.ajax__calendar_months
11.
.ajax__calendar_month
12.
.ajax__calendar_years
13.
.ajax__calendar_year
14.
.ajax__calendar_footer
15.
.ajax__calendar_today
16.
.ajax__calendar_hover
17.
.ajax__calendar_active
18.
.ajax__calendar_other
<title>Untitled Page</title>
</head>
<body>
<form id="form1"
runat="server">
<div>
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
<asp:TextBox ID="TextBox1"
runat="server"
style="top: 99px; left: 7px;
position: absolute; height: 22px;
width:
128px"></asp:TextBox>
<cc1:CalendarExtender
ID="TextBox1_CalendarExtender"
runat="server"
Enabled="True"
TargetControlID="TextBox1">
</cc1:CalendarExtender>
</div>
<p>
<asp:Label ID="Label1"
runat="server" Text="Select
Date"></asp:Label>
</p>
</form>
</body>
</html>
You can change your date format in textbox
using Property like shown in Diagram.
CascadingDropDown Control
Properties
1.
TargetControlID
2.
Category
3.
PromptText
4.
PromptValue
5.
EmptyText
6.
EmptyValue
7.
LoadingText
8.
ServicePath
9.
ServiceMethod
10.
ContextKey
11.
UseContextKey
12.
ParentControlID
13.
SelectedValue
2.
3.
protected void
Button1_Click(object sender,
EventArgs e)
{
Label1.Text = "Hello!!!!" +
"" +TextBox1.Text.ToString();
Label2.Text = "" +
TextBox2.Text.ToString();
}
The Design Code (Default.aspx)
<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<%@ Register
assembly="AjaxControlToolkit"
namespace="AjaxControlToolkit"
tagprefix="cc1" %>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DT
D/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/x
html">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.style2
{
width: 100%;
}
</style>
</head>
<body>
<form id="form1"
runat="server">
<div>
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
<asp:TextBox ID="TextBox1"
runat="server"
style="top: 86px; left: 10px;
position: absolute; height: 22px;
width:223px"></asp:TextBox>
<asp:TextBox ID="TextBox2"
runat="server"
style="top: 138px; left: 9px;
position: absolute; height: 21px;
width:
225px"></asp:TextBox>
<cc1:TextBoxWatermarkExtender
ID="TextBox2_TextBoxWatermarkE
xtender"
runat="server"
Enabled="True"
TargetControlID="TextBox2"
WatermarkText="Enter Your
Second Name..">
</cc1:TextBoxWatermarkExtender>
<asp:Button ID="Button1"
runat="server"
style="top: 134px; left:
294px; position: absolute; height:
26px;
width: 56px"
Text="Submit"
onclick="Button1_Click" />
</div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<asp:Label ID="Label1"
runat="server"></asp:Label>
<asp:Label ID="Label2"
runat="server"></asp:Label>
</form>
</body>
</html>
HoverMenu Control
1.
Properties
1. TargetControlID: Control ID of HoverMenu
Control.
2. PopupControlID: ID of the control which
display when mouse over on the HoverMenu
Control..
3. HoverCssClass: Css class.
4. PopupPostion: Popup should be positioned
relative to the target control
5. OffsetX/OffsetY: The number of pixels to
offset the Popup from it's default position
6. HoverDelay: The time, in milliseconds, before
the popup display.
7. PopDelay: The time, in milliseconds, for the
popup to remain visible.
8. Animations: Generic animations for the
HoverMenu extender.
xhtml">
<head runat="server">
<title>HoverMenu</title>
</head>
<body>
<form id="HoverMenu"
runat="server">
<div>
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
</div>
<cc1:HoverMenuExtender
ID="HoverMenuExtender1"
runat="server"
TargetControlID="LinkButton1"
PopupControlID="Panel1"
PopDelay="100"
HoverDelay="100"
PopupPosition="bottom">
</cc1:HoverMenuExtender>
<asp:LinkButton
ID="LinkButton1" runat="server"
FontSize="Larger">R4R</asp:LinkButt
on>
<asp:Panel ID="Panel1"
runat="server"
BackColor="#FF9900">
<asp:LinkButton
ID="LinkButton2" runat="server"
PostBackUrl="http://r4rtechsoft.co
m/">About Us</asp:LinkButton>
<asp:LinkButton
ID="LinkButton3" runat="server"
PostBackUrl="http://r4r.co.in/">Po
rtal</asp:LinkButton>
</asp:Panel>
</form>
</body>
</html>
}
protected void
Button1_Click(object sender,
EventArgs e)
{
Panel1.Visible = true;
}
}
Design Code
<asp:Button ID="Button1"
runat="server" Text="R4R
SoftTech."
onclick="Button1_Click"
/>
<asp:Panel ID="Panel1"
runat="server">
<asp:LinkButton
runat="server"
PostBackUrl="http://r4rtechsof
t.com/">
About Us</asp:LinkButton>
<asp:LinkButton
runat="server"
PostBackUrl="http://www.r4r.c
o.in/">
Portal</asp:LinkButton>
</asp:Panel>
<cc1:ConfirmButtonExtender
ID="Button1_ConfirmButtonEx
tender" runat="server"
ConfirmText="Are u Sure..."
Enabled="True"
TargetControlID="Button1">
</cc1:ConfirmButtonExtender
>
</form>
</body>
</html>
If Click on Ok then
Rating Control
The Rating control provides an intuitive rating
experience that allows users to select the number
of stars that represents their rating. Rating Control
is useful for those who need to show ratings in
ASP.NET more graphically.
Properties
1. AutoPostBack: True to cause a postback on
rating item click.
2. CurrentRating: Initial rating value
3. MaxRating: Maximum rating value
ToggleButton Control
ToggleButton is an ASP.NET AJAX extender that can
be attached to an ASP.NET CheckBox control,
ml">
<head runat="server">
<title>ToggleButton</title>
</head>
<body>
<form id="ToggleButton"
runat="server">
<div>
<asp:ScriptManager
ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<asp:CheckBox ID="CheckBox1"
runat="server"
oncheckedchanged="CheckBox1_Chec
kedChanged" />
<cc1:ToggleButtonExtender
ID="CheckBox1_ToggleButtonExtender
" runat="server"
Enabled="True"
CheckedImageUrl="ToggleButton_Chec
ked.gif"
TargetControlID="CheckBox1"
UncheckedImageUrl="ToggleButton_U
nchecked.gif"
CheckedImageAlternateText="Check"
UncheckedImageAlternateText="Unche
ck"
ImageHeight="20"
ImageWidth="20">
</cc1:ToggleButtonExtender>
<asp:LinkButton ID="LinkButton1"
runat="server" ForeColor="#FF3300"
PostBackUrl="http://www.helloanilyad
av.blogspot.com/">I like Anil
</asp:LinkButton>
<br />
<asp:CheckBox ID="CheckBox2"
runat="server" />
<cc1:ToggleButtonExtender
ID="CheckBox2_ToggleButtonExtender
" runat="server"
Enabled="True"
TargetControlID="CheckBox2"
CheckedImageUrl="ToggleButton_Chec
ked.gif"
CheckedImageAlternateText="Check"
UncheckedImageAlternateText="Unche
ck"
ImageHeight="20"
ImageWidth="20"
UncheckedImageUrl="ToggleButton_U
nchecked.gif">
</cc1:ToggleButtonExtender>
<asp:Button ID="Button1"
runat="server"
onclick="Button1_Click"
style="top: 110px; left: 9px;
position: absolute; height: 26px;
width: 56px"
Text="Submit" />
<asp:LinkButton ID="LinkButton2"
runat="server" ForeColor="#FF3300"
PostBackUrl="http://www.facebook.co
m/#!/pages/First-GirlFriend/152726921431770"
>I Like FGF</asp:LinkButton>
<p>
</p>
<p>
</p>
<asp:Label ID="Label3"
runat="server"></asp:Label>
</form>
</body>
</html>
On Button Click Code (Default.aspx.cs)
protected void Button1_Click(object
sender, EventArgs e)
{
Tabs Control
1.
TabContainer Properties
5. ContentTemplate
How to use Tabs Control
Step 1. Drag a ScriptManager and a TabContainer
Control from Ajax Control tab. Add three TabPanels
to the TabContainer and named as Personal
Information, Professional Information and Show
All respectively.
Add Three label and three TextBoxes to the
Personal Information tab.
Add Three label and three TextBoxes to the
Professional Information tab.
Add Six Label and one Button Control to the Show
All tab. Add a UpdatePanel and trigger the Button
control show below figure.
html1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xht
ml">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.style1 {
width: 100%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<cc1:ToolkitScriptManager
ID="ToolkitScriptManager1"
runat="server">
</cc1:ToolkitScriptManager>
</div>
<cc1:TabContainer
ID="TabContainer1" runat="server"
ActiveTabIndex="0"
Height="150px" Width="353px"
BackColor="#CC9900"
BorderColor="#CC3300"
BorderStyle="Groove">
<cc1:TabPanel ID="TabPanel1"
runat="server" HeaderText="Personal
Information"
Font-Bold="True">
<ContentTemplate>
<table>
<tr>
<td>
First Name:
</td><td><asp:TextBox
ID="TextBox1"
runat="server"></asp:TextBox></td>
</tr>
<tr>
<td>Second Name:</td>
<td><asp:TextBox ID="TextBox2"
runat="server"></asp:TextBox></td>
</tr>
<tr>
<td>Age:</td>
<td><asp:TextBox ID="TextBox3"
runat="server"></asp:TextBox></td>
</tr>
</table>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel2"
runat="server"
HeaderText="Professional Information"
Font-Bold="True">
<ContentTemplate>
<table>
<tr><td>Company Name:</td>
<td><asp:TextBox ID="TextBox4"
runat="server"></asp:TextBox></td>
</tr>
<tr><td>Phone Number:</td>
<td><asp:TextBox ID="TextBox5"
runat="server"></asp:TextBox></td>
</tr>
<tr><td>Email ID: </td>
<td><asp:TextBox ID="TextBox6"
runat="server"></asp:TextBox></td>
</tr>
</table>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel3"
runat="server" HeaderText="Show All"
BorderColor="#993300" FontBold="True">
<HeaderTemplate> Show
All</HeaderTemplate>
<ContentTemplate>
<asp:Button ID="Button1"
runat="server" Text="Click To Show
All"
onclick="Button1_Click" />
<asp:UpdatePanel
ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table>
<tr><td><asp:Label ID="Label1"
runat="server"
Text=""></asp:Label></td>
</tr>
<tr><td><asp:Label ID="Label2"
runat="server"
Text=""></asp:Label></td>
</tr>
<tr><td> <asp:Label ID="Label3"
runat="server"
Text=""></asp:Label></td>
</tr>
<tr><td><asp:Label ID="Label4"
runat="server"
Text=""></asp:Label></td>
</tr>
<tr><td> <asp:Label ID="Label5"
runat="server"
Text=""></asp:Label></td>
</tr>
</table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger
ControlID="Button1"
EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
</form>
</body>
</html>
On Button Click (Default.aspx.cs) Code
protected void Button1_Click(object
sender, EventArgs e)
{
Label1.Text = ("Name: " + "" +
TextBox1.Text +
TextBox2.Text).ToString();
Label2.Text = ("Age: " + ""
+TextBox3.Text.ToString());
Label3.Text = ("Your Company
Name: " + "" +
TextBox4.Text).ToString();
Label4.Text = ("Contact No.:" +
"" + TextBox5.Text).ToString();
Label5.Text = ("Email ID:" + ""
+ TextBox6.Text).ToString();
}
Slider Control
Slider Control allowed the user to choose a
numeric value from a finite range, min and max
value is created by Developer. The Slider's layout
can be customized to using CSS classes for the
Slider's rail and handle. If handle animation is
enabled, the handle slides to the specified point on
the rail with a nice animation effect. The Slider's
12.
BoundControlID: ID of the TextBox or
Label that dynamically displays the slider's
value.
13.
RaiseChangeOnlyOnMouseUp: If true,
fires the change event on the extended
TextBox only when the left mouse button is
released.
How To Use Slider Control
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DT
D/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/
xhtml">
<head runat="server">
<title>Slider</title>
</head>
<body>
<form id="Slider"
runat="server">
<div>
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
</div>
<cc1:SliderExtender
ID="SliderExtender1"
runat="server"
BoundControlID="TextBox2"
TargetControlID="TextBox1">
</cc1:SliderExtender>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2"
runat="server"
DragPanel Control
The DragPanel extender control provide facility to
drag controls. ASP. Net provide to use "drag
handle", means the control which is draggable. The
user easily drag control around whole web page.
Properties
1. TargetControlID: The ID of a Panel to make
draggable.
99/xhtml">
<head runat="server">
<title>DragPanel</title>
</head>
<body>
<form id="DragPanel"
runat="server">
<div>
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
</div>
<asp:Panel ID="Panel1"
runat="server" Width="250px"
style="z-index: 20;">
<asp:Panel
ID="Panel2"
runat="server"
Width="100%" Height="20px"
BorderStyle="Solid"
BorderWidth="2px"
BorderColor="black">
<div> &n
bsp;
<font
color="#0066FF"><b>
ASP.Net With
C#</b></font> </div>
</asp:Panel>
<asp:Panel
ID="Panel3" runat="server"
Width="100%"
Height="250px"
Style="overflow:
scroll;" BackColor="#0B3D73"
ForeColor="whitesmoke"
BorderWidth="2px"
BorderColor="black"
BorderStyle="Solid">
<div>
<p>
ASP .NET built on .net
framework. Asp .net is a web
development tool.
Asp .net is offered by
Microsoft.
We can built dynamic
websites by using asp .net.
Asp .net was first
released in January 2002 with
version 1.0 of the .net
framework.
It is the successor of
Microsoft's ASP. .NET
document.body.scrollHeight)
+"px";
}
setBodyHeightToContentHeight
();
</script>
</form>
</body>
</html>
</script>
The view of the Page When adding Color and
Visualization effect in the Panel like Show in
Design Code.
DropDown Control
1.
assembly="AjaxControlToolkit"
namespace="AjaxControlToolkit"
tagprefix="cc1" %>
<!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/xht
ml">
<head runat="server">
<title>DropDown</title>
</head>
<body>
<form id="DropDown"
runat="server">
<div>
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
</div>
<asp:Label ID="Label3"
runat="server" Text="Enter Your
Name: "
FontBold="True"></asp:Label><asp:Text
Box
ID="TextBox1"
runat="server"></asp:TextBox>
<br />
<asp:Label ID="Label1"
runat="server" Text="Please Select
your course......"
Font-Bold="True" FontNames="Times New Roman"
ForeColor="#993300"
TabIndex="1"></asp:Label>
<asp:ListBox ID="ListBox1"
runat="server" AutoPostBack="True"
onselectedindexchanged="ListBox1_S
electedIndexChanged"
ontextchanged="ListBox1_TextChang
ed" Font-Bold="False">
<asp:ListItem>C# with .Net
Framework</asp:ListItem>
<asp:ListItem>Java</asp:ListItem>
<asp:ListItem>ASP.Net with
C#</asp:ListItem>
<asp:ListItem>Networking</asp:ListI
tem>
</asp:ListBox>
<cc1:DropDownExtender
ID="Label1_DropDownExtender"
runat="server"
DropArrowBackColor="AliceBlue"
DropDownControlID="ListBox1"
DynamicServicePath=""
Enabled="True"
TargetControlID="Label1">
</cc1:DropDownExtender>
<p>
</p>
<asp:UpdatePanel
ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label2"
runat="server" FontBold="False"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger
ControlID="ListBox1"
EventName="SelectedIndexChanged"
/>
</Triggers>
</asp:UpdatePanel>
</form>
</body>
</html>
CollapsiblePanel Control
1.
4.
Properties
Click on ok.
Step 2. Copy the Control ID of the panel which
you want to Collapsed and paste this ID in
property, CollapseControlID="Panel2", of
CollapsePanelExtender Control. Add two label in
this Panel and make one label to its Text label, for
this copy the Label ID and paste it to the property
of (TextLabelID="Label5") CollapsePanelExtender
Control. Add four Label and four TextBoxes to the
Second Panel.
Step 3. For Second CollapsePanel (Personal
Information) Step2 repeated, For more help see
Design Code (Default.aspx).
Add a Button Control to submit Information.
<asp:Panel ID="Panel2"
runat="server" BorderColor="Black"
BorderWidth="2px"
BackColor="#CCCCCC"
Width="300px">
<table><tr>
<td><asp:Label ID="Label6"
runat="server" Text="Enter
Information"
FontBold="True"></asp:Label></td>
<td><asp:Label ID="Label5"
runat="server"
Text="Label"></asp:Label></td>
</tr></table>
</asp:Panel><asp:Button
ID="Button1" runat="server"
Text="Submit"
onclick="Button1_Click"
style="top: 48px; left: 348px;
position: absolute; height: 27px;
width: 86px" />
<asp:Panel ID="Panel3"
runat="server"
BackColor="#00CC99"
Width="300px">
<table>
<tr>
<td>
<asp:Label ID="Label1"
runat="server" Text="Name:
"></asp:Label></td><td>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox></td
>
</tr>
<tr><td>
<asp:Label ID="Label3"
runat="server" Text="Phone
No. :"></asp:Label></td>
<td>
<asp:TextBox ID="TextBox3"
runat="server"></asp:TextBox></td
></tr>
<tr><td>
<asp:Label ID="Label4"
runat="server" Text="Company
Name: ">
</asp:Label></td><td>
<asp:TextBox
ID="TextBox4"
runat="server"></asp:TextBox></td
>
</tr>
<tr><td>
<asp:Label ID="Label2"
runat="server" Text="Address:
"></asp:Label>
</td><td>
<asp:TextBox
ID="TextBox2" runat="server"
TextMode="MultiLine">
</asp:TextBox></td>
</tr>
</table>
</asp:Panel>
................/////
//For Personal information
<asp:Panel ID="Panel1"
runat="server" BorderColor="Black"
BorderWidth="2px"
BackColor="#CCCCCC"
Width="300px">
<table><tr>
<td><asp:Label ID="Label7"
runat="server" Text="Personel
Information"
FontBold="True"></asp:Label></td>
<td><asp:Label ID="Label8"
runat="server"
Text="Label"></asp:Label></td>
</tr></table>
</asp:Panel>
<asp:Panel ID="Panel4"
runat="server" Width="300px"
BackColor="#CCCC00">
<table>
<tr>
<td>
<asp:Label ID="Label9"
runat="server"
Text=""></asp:Label></td><td>
</td>
</tr>
<tr><td>
<asp:Label ID="Label10"
runat="server"
Text=""></asp:Label></td>
<td>
</td></tr>
<tr><td>
<asp:Label ID="Label11"
runat="server" Text="">
</asp:Label></td><td>
</td>
</tr>
<tr><td>
<asp:Label ID="Label12"
runat="server"
Text=""></asp:Label>
</td><td>
</td>
</tr>
</table>
</asp:Panel>
...........//////
//Extender Control(Personal
Information)
<cc1:CollapsiblePanelExtender
ID="Panel4_CollapsiblePanelExtender
"
runat="server" Enabled="True"
TargetControlID="Panel4"
ExpandControlID="Panel1"
TextLabelID="Label8"
CollapseControlID="Panel1"
CollapsedText="(Show
Information..)"
ExpandedText="(Hide
Information..)" Collapsed="True">
</cc1:CollapsiblePanelExtender>
......////
//Extender Control(Enter
Information)
<cc1:CollapsiblePanelExtender
ID="Panel1_CollapsiblePanelExtender
"
runat="server" Enabled="True"
TargetControlID="Panel3"
CollapseControlID="Panel2"
ExpandControlID="Panel2"
TextLabelID="Label5"
CollapsedText="(Show Panel..)"
ExpandedText="(Hide Panel..)">
</cc1:CollapsiblePanelExtender>
...../////
</form>
</body>
</html>
On click event of button (Default.aspx.cs)
protected void Button1_Click(object
sender, EventArgs e)
{
Label9.Text = "Hello!!!" + " "
+ TextBox1.Text.ToString();
Label10.Text = "Your Phone
Number:" + " " +
TextBox3.Text.ToString();
Label11.Text = "Company
Name:" + " " +
TextBox4.Text.ToString();
Label12.Text = "Address:" + "
" + TextBox2.Text.ToString();
}
ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<asp:Panel ID="Panel1"
runat="server" BackColor="Gray"
Width="300px">
<table><tr><td>
<asp:Label ID="Label1"
runat="server" Text="Name:
"></asp:Label>
</td><td>
<asp:TextBox
ID="TextBox1"
runat="server"></asp:TextBox></td>
</tr>
<tr><td>
<asp:Label ID="Label2"
runat="server" Text="Company name:
">
</asp:Label></td><td>
<asp:TextBox
ID="TextBox2"
runat="server"></asp:TextBox></td>
</tr>
</table>
</asp:Panel>
<table><tr><td>Show
Shadow:</td><td>
<asp:CheckBox ID="CheckBox1"
runat="server" AutoPostBack="True"
oncheckedchanged="CheckBox1_Chec
kedChanged" /></td></tr><tr>
<td>Rounded:</td><td>
<asp:CheckBox
ID="CheckBox2" runat="server"
AutoPostBack="True"
oncheckedchanged="CheckBox2_Chec
kedChanged" /></td></tr></table>
<cc1:DropShadowExtender
ID="Panel1_DropShadowExtender"
runat="server"
Enabled="True"
TargetControlID="Panel1"
Opacity="0">
</cc1:DropShadowExtender>
</form>
</body>
</html>
protected void
CheckBox1_CheckedChanged(object
sender, EventArgs e)
{
if (CheckBox1.Checked)
{ Panel1_DropShadowExtender.Opacity
= 5; }
else
{ Panel1_DropShadowExtender.Opacity
= 0; }
}
protected void
CheckBox2_CheckedChanged(object
sender, EventArgs e)
{
if (CheckBox2.Checked)
{ Panel1_DropShadowExtender.Rounde
d = true; }
else
{ Panel1_DropShadowExtender.Rounde
d = false; }
}]
FilteredTextBox Control
FilteredTextBox is an extender control, which
prevents the user to entering invalid characters
into a text box on the developer choice. This
Control is useful when you want to validate control
data without uses validation control.
Properties
runat="server"
Enabled="True"
FilterType="Numbers"
TargetControlID="TextBox1">
</cc1:FilteredTextBoxExtender>
</td></tr>
<tr><td>
<asp:Label ID="Label2"
runat="server" Text="Lower Case
Characters: ">
</asp:Label></td><td>
<asp:TextBox ID="TextBox2"
runat="server"></asp:TextBox>
<cc1:FilteredTextBoxExtender
ID="TextBox2_FilteredTextBoxExtend
er"
runat="server"
Enabled="True"
FilterType="LowercaseLetters"
TargetControlID="TextBox2">
</cc1:FilteredTextBoxExtender>
</td></tr>
<tr><td>
<asp:Label ID="Label3"
runat="server" Text="Upper Case
Characters: ">
</asp:Label></td><td>
<asp:TextBox ID="TextBox3"
runat="server"></asp:TextBox>
<cc1:FilteredTextBoxExtender
ID="TextBox3_FilteredTextBoxExtend
er"
runat="server"
Enabled="True"
FilterType="UppercaseLetters"
TargetControlID="TextBox3">
</cc1:FilteredTextBoxExtender>
</td></tr>
<tr><td>
<asp:Label ID="Label4"
runat="server" Text="No Digit:
"></asp:Label></td>
<td>
<asp:TextBox ID="TextBox4"
runat="server"></asp:TextBox>
<cc1:FilteredTextBoxExtender
ID="TextBox4_FilteredTextBoxExtend
er"
runat="server"
Enabled="True"
FilterMode="InvalidChars"
InvalidChars="1234567890"
TargetControlID="TextBox4">
</cc1:FilteredTextBoxExtender>
</td></tr>
<tr><td>
<asp:Label ID="Label5"
runat="server" Text="Only Maths
Symbol: ">
</asp:Label></td><td>
<asp:TextBox ID="TextBox5"
runat="server"></asp:TextBox>
<cc1:FilteredTextBoxExtender
ID="TextBox5_FilteredTextBoxExtend
er"
runat="server"
Enabled="True"
TargetControlID="TextBox5"
ValidChars="+-*/.">
</cc1:FilteredTextBoxExtender>
</td></tr>
</table>
</form>
</body>
</html>
RoundedCorners Control
The RoundedCorners extender applies rounded
corners to existing elements. It is a simple control
in use and make your application attractive. Here
you can choose the corners as your choice from
property of Extender Control, None, TopLeft,
TopRight, BottomRight, BottomLeft, Top, Right,
Bottom, Left with there Radius ( it is also a
property of Extender control).
Properties
namespace="AjaxControlToolkit"
tagprefix="cc1" %>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DT
D/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/x
html">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.style1
{
text-align: center;
}
.style2
{
text-align: justify;
}
</style>
</head>
<body>
<form id="form1"
runat="server">
<div>
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
</div>
<asp:Panel ID="Panel1"
runat="server" BackColor="Silver"
BorderColor="Black"
Font-Bold="True" FontSize="X-Large" Width="300px">
<div class="style1">
ASP.Net Ajax</div>
<div class="style2"
style="font-family: 'Times
New Roman', Times, serif; fontsize: medium;
font-weight: normal;
font-style: normal; backgroundcolor: #6666FF;">
Ajax (Asynchronous
JavaScript and XML) is a new
paradigm introduced in 2005. To
use Ajax, able to trade
data, with a web server, without
having to load a new
page. The purpose of
Ajax is that of giving the illusion
that websites are
responsive. It achieves
this by processing requests which
ResizableControl
ResizableControl is an extender that attaches to
any control or page element on a web page and
allowed the user to resize that control. This control
provide a handle, that attached to lower-right
corner of the control. from that image user resized
the image on web page. this handle image action
perform by the CSS code.
Properties
image:url(images/Han
dleGrip.png);
overflow:hidden;
cursor:se-resize;
}
A small JavaScript code to Show control Size
in a Alert box, when user perform resizable
operation for the control. This Method call on
the Property onClientResize.
<script type="text/javascript">
function onResize(sender,
eventArgs)
{
var e =
sender.get_element();
alert("Current height and
width of Resizable
Panel:\n\nwidth: "
+ e.scrollWidth + ", height: " +
e.scrollHeight);
}
</script>
Other property of extender Control you can change
according to your choice show below.
runat="server">
</asp:ScriptManager>
</div>
<asp:Panel ID="Panel1"
runat="server"
BackColor="#CCCC00"
Height="150px"
Width="150px">
<b style="font-family: 'Times
New Roman', Times, serif; font-size:
xx-large; font-weight: bold;
font-style: normal; color: #800000;
text-align: center;">
AJAX</b>
</asp:Panel>
<cc1:ResizableControlExtender
ID="Panel1_ResizableControlExtend
er"
runat="server"
MinimumHeight="50"
MinimumWidth="50"
MaximumHeight="400"
MaximumWidth="400"
HandleCssClass="handle"
OnClientResize="onResize"
TargetControlID="Panel1">
</cc1:ResizableControlExtender>
<style type="text/css">
.handle
{
width:16px;
height:16px;
backgroundimage:url(images/HandleGrip.png);
overflow:hidden;
cursor:se-resize;
}
</style>
<script type="text/javascript">
function onResize(sender,
eventArgs)
{
var e = sender.get_element();
alert("Current height and width of
Resizable Panel:\n\nwidth: "
+ e.scrollWidth + ", height: " +
e.scrollHeight);
}
</script>
<asp:Button ID="Button1"
runat="server"
onclick="Button1_Click"
Text="Reset" />
</form>
</body>
</html>
Properties
<html
xmlns="http://www.w3.org/1999/xht
ml">
<head runat="server">
<title>PopupControl</title>
</head>
<body>
<form id="PopupControl"
runat="server">
<div>
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
</div>
<cc1:PopupControlExtender
ID="TextBox1_PopupControlExtender"
runat="server"
DynamicServicePath=""
Enabled="True" ExtenderControlID=""
TargetControlID="TextBox1"
PopupControlID="Panel1">
</cc1:PopupControlExtender>
<b>Information About:
</b><asp:TextBox ID="TextBox1"
runat="server"
BackColor="#CCCCCC" FontBold="True" Height="28px"
Width="312px">
</asp:TextBox>
<asp:Panel ID="Panel1"
runat="server"
BackColor="#CCCCCC"
Height="150px"
Width="100px">
<asp:UpdatePanel
ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:RadioButtonList
ID="RadioButtonList1" runat="server"
onselectedindexchanged="RadioButto
nList1_SelectedIndexChanged"
AutoPostBack="True">
<asp:ListItem
Value="Object Oriented Programming
Language">
Java</asp:ListItem>
<asp:ListItem Value="Web
Development Technology">
ASP.Net</asp:ListItem>
<asp:ListItem
Value="System Application
Programming">C</asp:ListItem>
<asp:ListItem
Value="Object Oriented
Programming">C++</asp:ListItem>
<asp:ListItem
Value="Nothing">No
choice</asp:ListItem>
</asp:RadioButtonList>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<asp:UpdatePanel
ID="UpdatePanel2"
runat="server"><ContentTemplate>
<asp:Label ID="Label1"
runat="server"
ForeColor="#993300"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger
ControlID="Button1"
EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:Button ID="Button1"
runat="server"
onclick="Button1_Click"
Text="Show Information"
style="top: 73px; left: 338px;
position: absolute; height: 26px;
width: 117px" />
</form>
</body>
</html>
TextBox1.Text.ToString() +
" at the time" +
DateTime.Now.ToLongTimeString();
}
ListSearchExtender Control
The ListSearchExtender provide facility to search
items in a ListBox or DropDownList by typing a
word or phrase word. This control performs an
incremental search within the ListBox. The prompt
message is displayed when you click the list, that
can changed along with its CSS class and position.
Properties
AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<%@ Register
assembly="AjaxControlToolkit"
namespace="AjaxControlToolkit"
tagprefix="cc1" %>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DT
D/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/x
html">
<head runat="server">
<title>ListSearchExtender</title>
</head>
<body>
<form id="ListSearchExtender"
runat="server">
<div>
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
</div>
<asp:ListBox ID="ListBox1"
runat="server"
style="top: 83px; left: 9px;
position:
absolute; height: 70px;
width: 78px">
</asp:ListBox>
<cc1:ListSearchExtender
ID="ListBox1_ListSearchExtender"
runat="server"
Enabled="True"
IsSorted="True"
PromptCssClass=""
PromptText="Type to
search.."
TargetControlID="ListBox1">
</cc1:ListSearchExtender>
</form>
</body>
</html>
{
base.OnLoad(e);
ListBox1.DataSource = ItemList();
ListBox1.DataBind();
}
private static string[] wordListText;
public string[] ItemList()
{
if (null == wordListText)
{
string[] tempWordListText =
new string[] {
"Alfa","Alpha",
"Bravo","Charlie","Delta",
"Echo","Foxtrot",
"Golf", "Hotel", "India","Juliett",
"Juliet","Kilo", "Lima","Mike",
"November","Oscar","Papa",
"Quebec","Romeo", "Sierra",
"Tango","Uniform", "Victor",
"Whiskey", "Xray","Xray","Yankee","Zulu",
"Zero", "Nadazero", "One",
"Unaone","Two", "Bissotwo",
"Three","Terrathree",
"Four","Kartefour","Five","Pantafive","Six
", "Soxisix","Setteseven","Eight",
"Oktoeight", "Nine","Novenine"
};
Array.Sort(tempWordListText);
wordListText =
tempWordListText;
}
return wordListText;
}
MaskedEdit Control
MaskedEdit is an ASP.NET AJAX extender that
attaches to a TextBox control to make restriction
on user inputted text. MaskedEdit applies a "mask"
to the input that permits only certain types of
characters/text to be entered. Formats are:
Number, Date, Time, and DateTime. MaskedEdit
uses the culture settings specified in the
CultureName property.
MaskedEdit Properties
CultureDecimalPlaceholder: Culture
override
CultureThousandsPlaceholder: Culture
override
CultureTimePlaceholder: Culture override
MaskedEditValidator Properties
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/x
html1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xht
ml">
<head runat="server">
<title>ValidatorCallout</title></head
><body>
<form id="ValidatorCallout"
runat="server"><div>
<asp:ScriptManager
ID="ScriptManager1" runat="server">
</asp:ScriptManager></div>
<table><tr><td>Enter your Name:
</td>
<td><asp:TextBox ID="TextBox1"
runat="server" TabIndex="1"
BackColor="Silver"></asp:TextBox>
</td></tr><tr> <td>Passward:
</td><td>
<asp:TextBox
ID="TextBox2" runat="server"
TabIndex="2"
TextMode="Password"
BackColor="Silver"></asp:TextBox><
/td></tr>
<tr><td>Retype Passward:
</td><td>
<asp:TextBox
ID="TextBox3" runat="server"
TabIndex="3"
TextMode="Password"
BackColor="Silver">
</asp:TextBox></td></tr></table>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1"
runat="server"
ControlToValidate="TextBox1"
ErrorMessage="<b>Field
Missing</b><br/>
Name is Required"
Display="None"></asp:RequiredFieldV
alidator>
<cc1:ValidatorCalloutExtender
ID="ValidatorCalloutExtender1"
runat="server"
TargetControlID="RequiredFieldValidat
or1">
</cc1:ValidatorCalloutExtender>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2"
runat="server"
ErrorMessage="<b>Field
Missing</b><br/>Name is Required"
ControlToValidate="TextBox2"
Display="None">
</asp:RequiredFieldValidator>
<cc1:ValidatorCalloutExtender
ID="ValidatorCalloutExtender3"
runat="server"
TargetControlID="RequiredFieldValidat
or2">
</cc1:ValidatorCalloutExtender>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator3"
runat="server"
ControlToValidate="TextBox3"
ErrorMessage="<b>Field
Missing</b><br/>
Name is Required"
Display="None"></asp:RequiredFieldV
alidator>
<cc1:ValidatorCalloutExtender
ID="ValidatorCalloutExtender4"
runat="server"
TargetControlID="RequiredFieldValidat
or3">
</cc1:ValidatorCalloutExtender>
<asp:CompareValidator
ID="CompareValidator1"
runat="server"
ErrorMessage="<b>Password
Design View
PasswordStrength Control
1.
2.
3.
Properties
TargetControlID: ID of the TextBox, which
you add extender control
DisplayPosition: Positioning of the strength
indicator relative to the target control
RequiresUpperAndLowerCaseCharacters:
Specifies whether mixed case characters are
required
MinimumLowerCaseCharacters: Only in
effect if
RequiresUpperAndLowerCaseCharacters
property is true
MinimumUpperCaseCharacters: Only in
effect if
RequiresUpperAndLowerCaseCharacters
property is true
TextStrengthDescriptions: List of semi-colon
separated descriptions used when
StrengthIndicatorType=Text (Minimum of 2,
maximum of 10; order is weakest to strongest)
BarBorderCssClass: CSS class applied to the
bar indicator's border when
StrengthIndicatorType=BarIndicator
BarIndicatorCssClass: CSS class applied to
the bar indicator's inner bar when
StrengthIndicatorType=BarIndicator
HelpStatusLabelID: Control ID of the label
used to display help text
HelpHandleCssClass: CSS class applied to
the help element used to display a dialog box
describing the password requirements
html">
<head runat="server">
<title>PasswordStrength</title>
</head><body><form
id="PasswordStrength"
runat="server"><div>
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager></div>
<table><tr><td><asp:TextBox
ID="TextBox1" runat="server"
MaxLength="10"
TextMode="Password"></asp:TextB
ox>
</td></tr><tr><td><asp:Label
ID="Label1"
runat="server"></asp:Label>
</td></tr></table><cc1:Password
Strength
ID="TextBox1_PasswordStrength"
runat="server" Enabled="True"
HelpStatusLabelID="Label1"
PreferredPasswordLength="10"
TargetControlID="TextBox1"
TextStrengthDescriptions="Very
Poor;Weak;Average;Strong;Excelle
nt"
MinimumSymbolCharacters="1">
</cc1:PasswordStrength></form>
</body></html>
Step 3. Debug the Application
.MaskedEditFocusNegative
{ background-color: #ffffcc;
color: #ff0000;}
.MaskedEditBlurNegative
{color: #ff0000;}</style>
Design code (Default.aspx)
<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<%@ Register
assembly="AjaxControlToolkit"
namespace="AjaxControlToolkit"
tagprefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xht
ml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
>
<head
runat="server"><title>MaskedEdit</title
></head>
<body><form id="MaskedEdit"
runat="server"><div>
<asp:ScriptManager
ID="ScriptManager1" runat="server">
</asp:ScriptManager></div>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
<cc1:MaskedEditExtender
ID="TextBox1_MaskedEditExtender"
runat="server"
AcceptAMPM="True"
CultureAMPMPlaceholder=""
CultureCurrencySymbolPlaceholder=""
CultureDateFormat=""
CultureDatePlaceholder=""
CultureDecimalPlaceholder=""
CultureThousandsPlaceholder=""
CultureTimePlaceholder=""
Enabled="True"
InputDirection="RightToLeft"
Mask="9,999,999.99"
MaskType="Number"
TargetControlID="TextBox1"
ErrorTooltipEnabled="True">
</cc1:MaskedEditExtender>
<cc1:MaskedEditValidator
ID="MaskedEditValidator1"
runat="server"
ControlExtender="TextBox1_MaskedEdit
Extender" ControlToValidate="TextBox1"
Display="Dynamic"
EmptyValueBlurredText="*"
EmptyValueMessage="Blank not
Allowed"
InvalidValueBlurredMessage="*"
InvalidValueMessage="Only
number required"
MaximumValue="12000"
MaximumValueBlurredMessage="*"
MaximumValueMessage=">12000"
MinimumValue="50"
MinimumValueBlurredText="*"
MinimumValueMessage="<50"
TooltipMessage="Enter the No.
between 50 to 12000"
IsValidEmpty="False">
</cc1:MaskedEditValidator></form></b
ody></html>
SlideShow Control
1.
3.
Properties
return new
AjaxControlToolkit.Slide[]{
new
AjaxControlToolkit.Slide("image/Main.jp
g", "Front", "Go Ahead"),
new
AjaxControlToolkit.Slide("image/Baby.jp
g", "Baby", "Cute"),
new
AjaxControlToolkit.Slide("image/Image.j
pg", "Beautiful", "Most Precious"),
new
AjaxControlToolkit.Slide("image/Preciou
s.jpg", "Fabulous", "Cool Eye"),
new
AjaxControlToolkit.Slide("image/Face.jp
g", "Face", "Black and white"),
new
AjaxControlToolkit.Slide("image/Cute.jp
g", "Cute", "Hug Image"),
new
AjaxControlToolkit.Slide("image/Its
Over.jpg", "Its Over", "The End"),
};
}
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD
/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/x
html">
<head runat="server">
<title>SlideShow</title>
</head><body><form
id="SlideShow" runat="server">
<div><asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
</div><table><tr><td><b>Name:
</b>
<asp:Label ID="Label1"
runat="server" Font-Bold="True"
ForeColor="#FF3300"></asp:Label
></td></tr>
<tr><td> <asp:Image
ID="Image1" runat="server"
Height="300px"
ImageUrl="~/Image/ad.png"
style="top: 87px; left: 11px;
position: absolute" Width="500px"
/>
<cc1:SlideShowExtender
ID="Image1_SlideShowExtender"
runat="server"
Enabled="True"
NextButtonID="Button3"
PlayButtonID="Button2"
PlayButtonText="Play"
PlayInterval="300"
PreviousButtonID="Button1"
SlideShowServiceMethod="GetSlide
s" SlideShowServicePath=""
StopButtonText="||"
TargetControlID="Image1"
UseContextKey="True"
ImageDescriptionLabelID="label2"
ImageTitleLabelID="Label1">
</cc1:SlideShowExtender></td></
tr>
<tr><td><b>Description:
</b><asp:Label ID="Label2"
runat="server"
Font-Bold="True"
ForeColor="#663300"></asp:Label
></td></tr>
<tr><td><asp:Button
ID="Button1" runat="server"
Text="<<"
style="top: 402px; left:
MutuallyExclusiveCheckBox Control
MutuallyExclusiveCheckBox is an ASP.NET AJAX
extender that can be attached to any ASP.NET
CheckBox control. By adding a number of
checkboxes to the same "Key", only one checkbox
with the specified key can be checked at a time.
This extender is useful when a number of choices
are available but only one can be chosen, similar to
a radio button. The use of checkboxes however
allows you to choose to uncheck a value which is
not possible normally with radio buttons.
Properties
Default.aspx
<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<%@ Register
assembly="AjaxControlToolkit"
namespace="AjaxControlToolkit"
tagprefix="cc1" %>
<!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/xht
ml">
<head runat="server">
<title>MutuallyExclusiveCheckBox</t
itle></head><body>
<form
id="MutuallyExclusiveCheckBox"
runat="server">
<div><asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager></div>
<asp:Label ID="Label1"
runat="server" Text="Select a
Gender: "
Font-Bold="True"></asp:Label>
<asp:CheckBox ID="CheckBox1"
runat="server" Text="Male" />
<cc1:MutuallyExclusiveCheckBoxExte
nder
ID="CheckBox1_MutuallyExclusiveCh
eckBoxExtender"
runat="server" Enabled="True"
Key="Check"
TargetControlID="CheckBox1">
</cc1:MutuallyExclusiveCheckBoxExt
ender>
<asp:CheckBox ID="CheckBox2"
runat="server" Text="Female" />
<cc1:MutuallyExclusiveCheckBoxExte
nder
ID="CheckBox2_MutuallyExclusiveCh
eckBoxExtender"
runat="server" Enabled="True"
Key="Check"
TargetControlID="CheckBox2">
</cc1:MutuallyExclusiveCheckBoxExt
ender>
</form></body></html>
Step 4. Debug the Application. You select only
one item at a time.
NumericUpDown Control
NumericUpDown is an ASP.NET AJAX extender, can
be attached to an ASP.NET TextBox control and
used to add "up" and "down" buttons to increment
and decrement the value in the TextBox on
developer choice. Increment and decrement can be
simple +1/-1 arithmetic. This Increase or decrease
the value of provided list of values (like the months
of the year), or they can call a Web Service to
determine the next value.
Properties
July;August;September;October;No
vember;December"
ServiceDownMethod=""
ServiceUpMethod=""
TargetButtonDownID=""
TargetButtonUpID="">
</cc1:NumericUpDownExtender></
form></body></html>
{
if(args.keyCode ==
Sys.UI.Key.esc)
{
$find("ModalPopupExtenderLogin"
).hide();
}
}
function body_onkeydown()
{
if(event.keyCode==13 ||
event.keyCode==27)
{
var
_defaultButtonName=getDefautBu
ttonName( event.keyCode==13 ?
"submitButton" : "cancelButton");
var
frm=document.forms[0];
if(frm &&
document.all(_defaultButtonName
))
{
document.all(_defaultButtonName
).click();
}
}
}
function
getDefautButtonName(className)
{
var
_defaultButtonName="";
var children =
document.getElementsByTagNam
e("input");
for (var i = 0; i <
children.length; i++)
{
var var1 = children[i];
var btnAction =
var1.buttonAction;
if(btnAction ==
className)
{
_defaultButtonName
= var1.id;
break;
}
}
return
_defaultButtonName;
}
</script>
</head>
<body
onkeydown="body_onkeydown()"
>
<form id="form1"
runat="server">
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
<br />
<table style="width: 297px">
<tr>
<td style="width: 36px">
<asp:LinkButton
ID="Loginlnk" runat="server"
Width="47px">Login</asp:LinkB
utton></td>
<td>
<asp:LinkButton
ID="Signuplnk"
runat="server">Sign
Up</asp:LinkButton></td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="successLabel"
runat="server" Width="273px"
Visible="False"></asp:Label></t
d>
</tr>
</table>
<br />
<div>
<ajaxToolkit:ModalPopupExtender
ID="ModalPopupExtenderLogin"
runat="server"
TargetControlID="Loginlnk"
PopupControlID="LoginPanel"
BackgroundCssClass="modalBack
ground"
DropShadow="true"
OkControlID="LoginBtn"
OnOkScript="ok()"
CancelControlID="CancelBtn" />
<ajaxToolkit:ModalPopupExtender
ID="ModalPopupExtenderSignup"
runat="server"
TargetControlID="Signuplnk"
PopupControlID="SignupPanel"
BackgroundCssClass="modalBack
ground"
DropShadow="true"
OkControlID="JoinBtn"
OnOkScript="okJoin()"
CancelControlID="CancelBtn2" />
<br />
<br />
<asp:Panel ID="LoginPanel"
runat="server"
CssClass="modalPopup"
Style="display: none"
Width="278px"
Font-Names="@MS PGothic">
<table style="width:
270px">
<tr>
<td style="width:
30% " align="right">
<asp:Label
ID="Label10" runat="server"
Height="23px"
Text="UserName :"></asp:Label
>
</td>
<td style="width:
179px" >
<asp:TextBox ID="loginId"
runat="server"
Width="75%"></asp:TextBox></
td>
</tr>
<tr>
<td style="width:
30% " align="right">
<asp:Label
ID="Label9" runat="server"
Height="23px"
Text="Password :"></asp:Label>
</td>
<td style="width:
179px">
<asp:TextBox
ID="pwd" runat="server"
Width="75%"></asp:TextBox></
td>
</tr>
<tr>
<td style="width:
94px">
</td>
<td style="width:
179px">
<asp:Button
ID="CancelBtn" runat="server"
Text="Cancel" Width="52px"
buttonAction="submitButton" />
<asp:Button
ID="LoginBtn" runat="server"
Text="Log In"
OnClick="LoginBtn_Click"
buttonAction="cancelButton"
/></td>
</tr>
</table>
<br />
</asp:Panel>
<br />
<asp:Panel ID="SignUpPanel"
runat="server"
CssClass="modalSignUp"
Style="display: none"
Width="539px"
Font-Names="@MS PGothic">
<span style="color:
#cc0000"><strong><span
style="color: dimgray">Welcome
to
ModalPopupExtender.com<br />
</span></strong><br />
</span>
If you already have an
account, you can also <span
style="color: dimgray"><span>
login</span> </span>
above.
<br />
<table style="width:
452px; height: 177px;"
Align="center">
<tr>
<td colspan="2"
style="height: 21px">
</td>
</tr>
<tr>
<td style="width:
30% " align="right">
<asp:Label
ID="Label1" runat="server"
Height="23px" Text="Choose
username :"></asp:Label>
</td>
<td style="width:
179px" >
<asp:TextBox
ID="txtUserName" runat="server"
Width="100%"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width:
30%" align="right">
<asp:Label
ID="Label2" runat="server"
Height="23px"
Text="Password :"></asp:Label>
</td>
<td style="width:
179px">
<asp:TextBox
ID="txtPassword" runat="server"
Width="100%"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width:
30% " align="right">
<asp:Label
ID="Label3" runat="server"
Height="23px" Text="Confirm
password :"></asp:Label>
</td>
<td style="width:
179px">
<asp:TextBox
ID="txtConfirmPassword"
runat="server"
Width="100%"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width:
30% " align="right">
<asp:Label
ID="Label4" runat="server"
Height="23px" Text="Email
address:"></asp:Label></td>
<td style="width:
179px">
<asp:TextBox
ID="txtEmailAddress"
runat="server"
Width="100%"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width:
30% " align="right">
<asp:Label
ID="Label6" runat="server"
Height="23px" Text="First
Name:"></asp:Label></td>
<td style="width:
179px">
<asp:TextBox
ID="txtFirstName" runat="server"
Width="100%"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width:
30% " align="right">
<asp:Label
ID="Label7" runat="server"
Height="23px" Text="Last
Name :"></asp:Label></td>
<td style="width:
179px">
<asp:TextBox
ID="txtLastName" runat="server"
Width="100%"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width:
30% " align="right">
<asp:Label
ID="Label5" runat="server"
Height="23px"
Text="Zipcode:"></asp:Label></
td>
<td style="width:
179px">
<asp:TextBox
ID="txtZipcode" runat="server"
Width="100%"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right"
style="width: 30%; height:
18px">
<asp:Label
ID="Label8" runat="server"
Height="23px"
Text="Gender:"></asp:Label></t
d>
<td style="width:
179px; height: 18px">
<asp:RadioButtonList
ID="rblGender" runat="server"
RepeatDirection="Horizontal"
Height="19px">
<asp:ListItem>Male</asp:ListIte
m>
<asp:ListItem>Female</asp:ListI
tem>
</asp:RadioButtonList></td>
</tr>
104px;
179px;
<tr>
<td style="width:
height: 26px;">
</td>
<td style="width:
height: 26px;">
<asp:Button ID="CancelBtn2"
runat="server" Text="Cancel"
Width="52px" />
<asp:Button ID="JoinBtn"
runat="server" Text="Join"
OnClick="JoinBtn_Click" /></td>
</tr>
</table>
<br />
</asp:Panel>
</div>
</form>
</body>
</html>
Step 6. Now run your web site by Ctrl + F5
Step 7. Output is
MultiHandleSliderExtender Control
The MultiHandleSlider extender provides a featurerich extension to a regular asp:Textbox control.This
control reduced the need to use four DropDownlist
controls to hold the range values and the need for
a validation control. It allows you to choose a
single value, or multiple values in a range, through
a graphical slider interface.It supports one handle,
dual handles, or any number of handles bound to
the values of asp:TextBox or asp:Label controls. It
also provides options for read-only access, custom
graphic styling, hover and drag handle styles, as
well as mouse and keyboard support for
accessibility.
MultiHandleSliderExtender Control property
EnableKeyboard - using the keyboard.,slider
values can be changed
EnableMouseWheel -using the mouse wheel.,
slider values can be changed
Increment - For sliders using keyboard or mouse
wheel support; determines the number of points to
increment or decrement the slider values
BoundControlID - For backwards compatibility,
allows using classic Slider properties for a single
handle.
RaiseChangeOnlyOnMouseUp - fires the
change event on the extended TextBox only when
the left mouse button is released, If true.
MultiHandleSliderTargets - An inner property
describing each handle on the slider.
Minimum - Minimum value allowed.
Maximum - Maximum value allowed.
Length - The length of the graphical slider, in
pixels.
<%@ Register
Assembly="AjaxControlTool
kit"
Namespace="AjaxControlTo
olkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xht
ml1/DTD/xhtml1transitional.dtd">
<html
xmlns="http://www.w3.org
/1999/xhtml">
<head runat="server">
<title>Untitled
Page</title>
</head>
<body bgcolor="#9999ff">
<form id="form1"
runat="server">
<div>
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
<asp:TextBox
ID="TextBox1"
runat="server"
BackColor="#FF9966"></a
sp:TextBox>
<asp:TextBox
ID="TextBox2"
runat="server"
BackColor="#FF66FF"></as
p:TextBox>
<asp:TextBox
ID="txtSlider"
runat="server"
Width="40px"
BackColor="Fuchsia"></asp
:TextBox>
<cc1:MultiHandleSliderExte
nder
ID="MultiHandleSliderExten
der1" runat="server"
TargetControlID="txtSlider"
BehaviorID="multiHandleSli
derOne" Minimum="0"
Maximum="100"
Steps="50" Length="317">
<MultiHandleSliderTargets>
<cc1:MultiHandleSliderTarg
et ControlID="TextBox1" />
<cc1:MultiHandleSliderTarg
et ControlID="TextBox2" />
</MultiHandleSliderTargets
>
</cc1:MultiHandleSliderExt
ender>
</div>
</form>
</body>
</html>
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
<asp:Panel ID="Panel1" runat="server"
BackColor="#999999">
<div><center>Choices...</center></div>
<asp:Label ID="label1" runat="server"
Text="Course" Font-Bold="true"/><br />
<br />
<asp:CheckBox ID ="CheckBox1" runat="server"
Text="MCA" /><br />
<asp:CheckBox ID ="CheckBox2"
runat="server" Text="B.Tech" />
<br />
<br />
<asp:Label ID="label2" runat="server"
Text="Gender" Font-Bold="true" />
<br />
<br />
<asp:CheckBox ID ="CheckBox3"
runat="server" Text="Male" />
<br />
<asp:CheckBox ID ="CheckBox4"
runat="server" Text="FeMale" />
</asp:Panel>
<cc1:MutuallyExclusiveCheckBoxExtender
ID="MutuallyExclusiveCheckBoxExtender1"
runat="server" Key="Course"
TargetControlID="CheckBox1">
</cc1:MutuallyExclusiveCheckBoxExtender>
<cc1:MutuallyExclusiveCheckBoxExtender
ID="MutuallyExclusiveCheckBoxExtender2"
runat="server" Key="Course"
TargetControlID="CheckBox2">
</cc1:MutuallyExclusiveCheckBoxExtender>
<cc1:MutuallyExclusiveCheckBoxExtender
ID="MutuallyExclusiveCheckBoxExtender3"
runat="server" Key="Gender"
TargetControlID="CheckBox3">
</cc1:MutuallyExclusiveCheckBoxExtender>
<cc1:MutuallyExclusiveCheckBoxExtender
ID="MutuallyExclusiveCheckBoxExtender4"
runat="server" Key="Gender"
TargetControlID="CheckBox4">
</cc1:MutuallyExclusiveCheckBoxExtender>
</div>
</form>
</body>
</html>
NoBot Control
NoBot is a control that try to provide CAPTCHA-like
bot/spam prevention without requiring any user
interaction.AJAX NoBot control checks whether all
the client side javascript is working or has been
disabled by the spamming software.ASP.Net AJAX
NoBot extender Control returns different types of
responses when a user sends a request and
After that .
Design code
<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<%@ Register
Assembly="AjaxControlToolkit"
Namespace="AjaxControlToolkit"
TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xht
ml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
>
<head runat="server">
<title>Untitled Page</title>
</head>
<body bgcolor="#6666ff">
<form id="form1" runat="server">
<div>
<asp:ScriptManager
ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Label ID="Label1"
runat="server" Text="NoBot Response
State:"
Font-Bold="true" FontSize="14px"></asp:Label>
<asp:Label ID="Label2" runat="server"
Font-Size="16px"></asp:Label>
<div class="clear"><br />
<asp:Label ID="Label3" runat="server"
Text="Client IP Address:" FontBold="true"
Font-Size="14px"></asp:Label>
<div class="clear"></div>
<asp:Label ID="Label4" runat="server"
Font-Size="16px"></asp:Label>
<div class="clear"><br />
</div>
<cc1:NoBot ID="NoBot1"
runat="server"
CutoffMaximumInstances="5"
CutoffWindowSeconds="60"
ResponseMinimumDelaySeconds="2"
/>
<asp:Button ID="Button1"
runat="server" Text="Check Spam"
OnClick="Button1_Click" />
</div>
</form>
</body>
</html
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;
using AjaxControlToolkit;
using System.Collections.Generic;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender,
EventArgs e)
{
}
protected void Button1_Click(object sender,
EventArgs e)
{
NoBotState nbs;
// if condition to check the response nbs of
NoBot
if (NoBot1.IsValid(out nbs))
{
Label2.Text = nbs.ToString();
}
else
{
Label2.Text = nbs.ToString();
}
StringBuilder sb = new StringBuilder();
// foreach loop to get cached IP address and
datetime assocated with it
(when last postback was occurred)
foreach (KeyValuePair<DateTime, string>
keyValue in NoBot.GetCopyOfUserAddressCache())
{
sb.AppendFormat("{0}: {1}<br />",
keyValue.Key.ToString(), keyValue.Value);
}
Label4.Text = sb.ToString();
}
}
ReorderList Control
ReorderList is an ASP.NET AJAX control that
implements a bulleted, data-bound list with items
that can be reordered interactively.This is useful if
AnimationExtender Control
AnimationExtender Control is an ajax control that
provides powerful animation framework with
existing pages in an easy, declarative fashion
animation effect .such as moving an ASP Control
to a new place, resizing it, modifying its color, or
making it fade in or fade out.
AnimationExtender Control property
TargetControlID -It is the ID of the target
control which events are used to animate
OnLoad - when page is loaded, Generic animation
created
OnClick - when the target control is
clicked,Generic animation created
OnMouseOver - when the mouse moves over the
target control than Generic animation created
OnMouseOut - Generic animation created when
the mouse moves out of the target control
OnHoverOver it is same as an OnMouseOver
except before it plays, stop the OnHoverOut
animation
OnHoverOut - It is same as an OnMouseOutr
except before it plays, stop the OnHoverOut
animation
How To Use AnimationExtender control
</Sequence>
</OnClick>
</Animations>
</cc1:AnimationExtender>
<asp:Panel ID="Panel1" runat="server">
<asp:Button ID="Button1" runat="server"
Text="Animation" OnClick="Button1_Click" />
<asp:Label ID="Label1" runat="server"
BackColor="#33CCFF"></asp:Label>
</asp:Panel>
</div>
</form>
</body>
</html>
........................................CS
CODE.......................................................
using
using
using
using
using
using
using
using
using
using
using
System;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.HtmlControls;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Xml.Linq;
MaskedEditExtender Control
MaskedEdit is an ASP.NET AJAX extender control
that attaches to a TextBox control to prevent the
kind of text that can be entered.When we use
MaskedEdit ,the input is masked and the value is
validated on the client according to the MaskType
selection.. The MaskedEdit control integrated with
the MaskedEditValidator for verify the input
MaskType - Type of validation to perform:
None - No validation
Number - Number validation
Date - Date validation
Time - Time validation
DateTime - Date and time validation
Mask Characters and Delimiters
9 - Only a numeric character
L - Only a letter
$ - Only a letter or a space
C - Only a custom character (case sensitive)
A - Only a letter or a custom character
N - Only a numeric or custom character
? - Any character
/ - Date separator
: - Time separator
. - Decimal separator
, - Thousand separator
\ - Escape character
{ - Initial delimiter for repetition of masks
} - Final delimiter for repetition of masks
MaskedEditExtender Control Property
AutoCompleteValue -when Auto complete is true
when defult character is used.
Century - when a date mask only has two digits for
the year than used Default century
ClearMaskOnLostFocus - If it is True then remove
the mask when the TextBox loses focus
ClearTextOnInvalid -If condition is true then clear
the textbox when entered invalid text.
ClipboardEnabled - True to allow copy/paste with
the clipboard
ClipboardText - when a clipboard paste is
performed,then Prompt text to use .
DisplayMoney - Specifies how the currency symbol
is displaye
How To Use MaskedEditExtender Control
Step 1. Start -> All Programs -> Visual Studio
2005 or Visual Studio 2008
Step 2. Now go to File Menu -> New -> Web Site
Step 3.
Under Visual Studio Installed Template-> Choose
ASP.NET WEB SITE -> Choose File System from
the location combo box -> Set the path by the
browse button - > Choose the language from the
Language ComboBox (Visual C# ,Visual Basic , J
#)
Choose Visual C#
Step 4. Click on the OK Button.
Step 5. Now drag some controls under the AJAX
Extensions.
First control you are going to drag and drop on the
page is - Script Manager.
After that .
CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit"
Namespace="AjaxControlToolkit"
TagPrefix="cc1" %>
<!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>Untitled Page</title>
</head>
<body bgcolor="#66ff66">
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
<br />
&
nbsp;
&
nbsp;
<asp:Label ID="Label1" runat="server"
Text="Name" Font-Bold="True"></asp:Label>
&
nbsp;
&
nbsp;
<asp:TextBox ID="TextBox1" runat="server"
BackColor="#CCCCFF"></asp:TextBox>
<br />
&
nbsp;
<asp:Label ID="Label2" runat="server" FontBold="True" Text="MobileNumber">
</asp:Label>
&
nbsp; &n
bsp;
<asp:TextBox ID="TextBox2" runat="server"
BackColor="#FFFFCC"></asp:TextBox>
<cc1:MaskedEditExtender
ID="MaskedEditExtender1"
runat="server"
TargetControlID="TextBox2"
MaskType="Number" Mask="9999999999"
MessageValidatorTip="true"
AcceptNegative="None"
InputDirection="RightToLeft"
ErrorTooltipEnabled="true">
</cc1:MaskedEditExtender>
<cc1:MaskedEditValidator
ID="MaskedEditValidator1" runat="server"
ControlToValidate="TextBox2"
ControlExtender="MaskedEditExtender1"
MinimumValue="1000000000"
MinimumValueMessage="Please enter
correc mobile number"
MaximumValueMessage="Invalid
mobile number! The highest roll
number is 105" Display="Dynamic"
IsValidEmpty="false"
InvalidValueMessage="The mobile number
does not exist"
EmptyValueMessage="Mobile number is
not entered"></cc1:MaskedEditValidator>
</div>
</form>
</body>
</html>