FilteredTextBoxExtender
<cc1:FilteredTextBoxExtender ID=”FilteredTextBoxExtender1″ runat=”server” TargetControlID=”txt_Sno” ValidChars=”0123456789″>
</cc1:FilteredTextBoxExtender>
RequiredFieldValidator
<asp:TextBox ID=”txt_Name” runat=”server” Font-Names=”Verdana” Font-Size=”10pt” Width=”164px” MaxLength=”20″ TabIndex=”2″></asp:TextBox><span
style=”font-size: 10pt”></span>
<asp:RequiredFieldValidator ID=”RequiredFieldValidator1″ runat=”server” ControlToValidate=”txt_Name” ErrorMessage=”Please Enter Name” Font-Names=”Verdana” Font-Size=”8pt” ValidationGroup=”validity”>*</asp:RequiredFieldValidator></td>
ValidationSummary
<asp:ValidationSummary ID=”ValidationSummary1″ runat=”server” ShowMessageBox=”True”
ShowSummary=”False” ValidationGroup=”validity” />
RadioButton AutoSelection
<asp:RadioButtonList ID=”rdio_Gender” runat=”server” Font-Names=”Verdana” Font-Size=”10pt” Width=”80px” ForeColor=”ControlText” RepeatDirection=”Horizontal” TabIndex=”6″>
<asp:ListItem Selected=”True”>Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem> </asp:RadioButtonList>
<?xml version=“1.0“ encoding=“utf-8“ ?>
AdRotator:
<Advertisements>
<Ad>
<ImageUrl>Images/IMG_0016.jpg</ImageUrl>
<NavigateUrl>http://www.quantumasia.in/</NavigateUrl>
<AlternateText>Quantum Asia Pvt Ltd</AlternateText>
<Keyword>A</Keyword>
<Impressions>10</Impressions>
<Caption>This is ap govt</Caption>
</Ad>
Print Button:
protected void LinkButton5_Click(object sender, EventArgs e)
{
Response.Write(“<script language=’javascript’>”);
Response.Write(“window.print()”);
Response.Write(“</script>”);
}
Marquee:
<td colspan=”2″ style=”text-align: center”>
<marquee onMouseOver=’this.scrollAmount=”0″‘ style=”FONT-WEIGHT: normal; FONT-SIZE: 10px; COLOR: #333333; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif”width=”300″ onMouseOut=’this.scrollAmount=”2″‘ scrollamount=”1″ scrolldelay=”0″ direction=”up” height=”90″>
<img src=”/CitizenPortal/Logos/APPSC.gif”> Tigh security in Kandhmal<br><br>
<img src=”/CitizenPortal/Logos/Electricity.gif”> swin flu toll reaches 18<br><br>
<img src=”/CitizenPortal/Logos/Metro.gif”> PM Sets up crack Team
<br>
</marquee>
</td>
Message Box:
ClientScript.RegisterStartupScript(this.GetType(), “siva”, “<script>alert(‘Entered User Name or Password Wrong’)</script>”);
Page.RegisterClientScriptBlock(“siva”, “<script>alert(‘Employee ID not Found’)</script>”);
catch (Exception e)
{
ClientScript.RegisterStartupScript(this.GetType(), “msg”, “<Script>alert(””+e.ToString()+“”)</Script>”);
Adding Custom Content To Calender:
<script language=”C#” runat=”server”>
String [][] holidays;
void Page_Load(Object Sender, EventArgs e) {
holidays = new String[13][];
for (int n=0; n<13 ;n++)
holidays[n] = new String[32];
holidays[1][1] = “New Year’s Day”;
holidays[1][26] = “Republic Day”;
holidays[2][14] = “Valentine’s Day”;
holidays[2][23] = “Mahashivratri”;
holidays[3][17] = “St. Patrick’s Day”;
holidays[5][1] = “May Day”;
holidays[8][15] = “Independence Day”;
holidays[9][28] = “Vijaya Dashami”;
holidays[10][2] = “Mahatma Gandhi’s Birthday”;
holidays[10][17] = “Diwali”;
holidays[11][27] = “Idu’l Zuha/Bakrid “;
holidays[12][18] = “Muharram”;
holidays[12][25] = “Christmas Day”;
}
void Calendar1_DayRender(object sender, DayRenderEventArgs e) {
CalendarDay d = ((DayRenderEventArgs)e).Day;
TableCell c = ((DayRenderEventArgs)e).Cell;
if (d.IsOtherMonth) {
c.Controls.Clear();
}
else {
try {
string Hol = holidays[d.Date.Month][d.Date.Day];
if (Hol != string.Empty)
c.Controls.Add(new LiteralControl(“<br>” + Hol));
}
catch (Exception exc) {
Response.Write (exc.ToString());
}
}
}
</script>
Mouse-Over Effects on Button:
<asp:Button id=Button1 runat=”server”
Text=”Button1″
Width=”100px”
onmouseover=”this.style.backgroundColor=’yellow’”
onmouseout=”this.style.backgroundColor=’buttonface’”
onclick=”Button1_Click” />
<asp:Button id=Button2 runat=”server”
Text=”Button2″
Width=”100px”
onmouseover=”this.style.fontWeight=’bold’”
onmouseout=”this.style.fontWeight=’normal’”
onclick=”Button2_Click” />
page-auto Refresh
<meta http-equiv=”refresh” content=”1; url=Web Page>
<meta content=”Microsoft Visual Studio .NET 7.1″ name=”GENERATOR”>
<meta content=”C#” name=”CODE_LANGUAGE”>
<!–The next line of code will refresh the page every 5 minutes–>
<meta http-equiv=”refresh” content=”5″>
<meta content=”JavaScript” name=”vs_defaultClientScript”>
<meta content=”http://schemas.microsoft.com/intellisense/ie5″
name=”vs_targetSchema”>
Style sheets
<title>TriColor by Free CSS Templates</title>
<link href=”style.css” rel=”stylesheet” type=”text/css” media=”screen” />
</head>
AlwaysVisibleControlExtender
<cc1:AlwaysVisibleControlExtender ID=”AlwaysVisibleControlExtender1″ runat=”server”
HorizontalOffset=”10″ HorizontalSide=”Right” TargetControlID=”Label1″ VerticalOffset=”10″
VerticalSide=”Top”>
</cc1:AlwaysVisibleControlExtender>
Validatorcalloutextender:
<cc1:validatorcalloutextender id=”ValidatorCalloutExtender1″ runat=”server” targetcontrolid=”RequiredFieldValidator1″ Width=”350px”></cc1:validatorcalloutextender>
ConfirmButtonExtender:
<cc1:ConfirmButtonExtender ID=”ConfirmButtonExtender1″ runat=”server” ConfirmText=”Are you sure you want to Submit” OnClientCancel=”CancelClick”
TargetControlID=”Button1″>
</cc1:ConfirmButtonExtender>
CollapsiblePanelExtender:
<cc1:CollapsiblePanelExtender ID=”CollapsiblePanelExtender1″ runat=”server” CollapseControlID=”LinkButton1″ Collapsed=”True” CollapsedSize=”0″ CollapsedText=”Show Details” ExpandControlID=”LinkButton1″ ExpandedSize=”300″ ExpandedText=”Hide Details” ImageControlID=”Image1″ ScrollContents=”True” SuppressPostBack=”True” TargetControlID=”Panel1″ TextLabelID=”Label1″>
</cc1:CollapsiblePanelExtender>
ModalPopupExtender:
<cc1:ModalPopupExtender ID=”ModalPopupExtender1″ runat=”server” TargetControlID=”LinkButton1″ CancelControlID=”btn_Cancel” OkControlID=”btn_Ok” PopupControlID=”Panel1″ PopupDragHandleControlID=”Panel2″ BackgroundCssClass=”modalBackground “ DropShadow=”True”>
</cc1:ModalPopupExtender>
Update Panel:
<asp:UpdatePanel ID=”UpdatePanel1″ runat=”server”>
<ContentTemplate>
<asp:Label ID=”lbl_Datetime” runat=”server” Font-Names=”Verdana” Font-Size=”9pt” Text=”Label” Width=”205px”></asp:Label>
<asp:Timer ID=”Timer1″ runat=”server” Interval=”1000″OnTick=”Timer1_Tick”>
</asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
</script><script type=”text/javascript”>
Sys.UI.DomEvent.addHandler($get(“Button1″), “click”, formatDate);
function formatDate() {
var d = new Date();
try {
$get(‘Label1′).innerHTML = d.localeFormat(“dddd, dd MMMM yyyy HH:mm:ss”);
}
catch(e) {
alert(“Error:” + e.message);
}
}
Default Button & Default Focus
<body bgcolor=”aliceblue” style=”font-size: 12pt”>
<form id=”form1″ runat=”server” defaultbutton=”btn_Submit” defaultfocus=”txt_Sno”>
<div>
<div id=”step1″ class=”register_upstep”>
No comments:
Post a Comment