tag:blogger.com,1999:blog-31592715078547799462024-02-07T13:46:21.842-08:00Aspdotnet StudioC#,AJAX,ADO.NET,JAVASCRIPT,HTML,CSS TutorialsMy Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.comBlogger33125tag:blogger.com,1999:blog-3159271507854779946.post-17128057387315200032014-02-26T03:48:00.002-08:002014-02-26T03:48:38.662-08:00Send Email to all user's email Id in the Database in Asp.net<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<pre name="code"><div dir="ltr" trbidi="on">
<div dir="ltr" trbidi="on">
<div style="text-align: justify;">
<u style="font-family: Verdana, sans-serif; font-weight: bold;">Description:-</u><span style="font-family: Verdana, sans-serif;"> Hello Friends Today we will learn that how to send email to all the user's email id in the database on Button click event.First of all we will create a button on design page.On the onclick event give a name to the event whatever you want.Second thing you have to make a Table in the database that is containing Column for email in which the email id for all the user are stored.i will also provide you snapshots for creating your Table in the database.the snapshot for database are given below.</span><br />
<u style="font-family: Verdana, sans-serif; font-weight: bold;">Database Table:-</u><span style="font-family: Verdana, sans-serif;"> Design Table according to your Data that you want to store in the database.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Verdana, sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj72qkEWYZjnT1u4Z-DR26W3x_upJrfllniVSNKdc99QgYEImUvUftGDw-rtld1R-bxc3JoqEfZlIvSBJi0J9-p2Np9RTKtAV5m2AM_IV-4SyhGknRnEgoGh3Fr3VXTC4NL64n3R43yNUM/s1600/Screenshot_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj72qkEWYZjnT1u4Z-DR26W3x_upJrfllniVSNKdc99QgYEImUvUftGDw-rtld1R-bxc3JoqEfZlIvSBJi0J9-p2Np9RTKtAV5m2AM_IV-4SyhGknRnEgoGh3Fr3VXTC4NL64n3R43yNUM/s1600/Screenshot_1.png" /></a></span></div>
</div>
<span style="font-family: Verdana, sans-serif;">
</span>
<span style="font-family: Verdana, sans-serif;">After Creating add the data to the table.Now the code for Design page is below.</span><br />
<span style="font-family: Verdana, sans-serif;"><span id="goog_1052711740"></span><span id="goog_1052711741"></span>
</span><u style="font-family: Verdana, sans-serif; font-weight: bold; text-align: justify;">Demo:-</u><br />
<span style="font-family: Verdana, sans-serif;">
</span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizlSpHaF-c2dzTUXjngNPl2R50hFm1nW-XedFsJaEoyRU4LzkWiAes-yRZXsjmaIujkw3rN1bktgog0sG6GFbLyjRZVMXeq3wtS3dYEdOQmaqLbj511qdC-F7Lo5ejzzuNHn9pg8zRgfk/s1600/demo.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizlSpHaF-c2dzTUXjngNPl2R50hFm1nW-XedFsJaEoyRU4LzkWiAes-yRZXsjmaIujkw3rN1bktgog0sG6GFbLyjRZVMXeq3wtS3dYEdOQmaqLbj511qdC-F7Lo5ejzzuNHn9pg8zRgfk/s1600/demo.gif" /></a></div>
<u style="font-family: Verdana, sans-serif; font-weight: bold; text-align: justify;">
</u>
<br />
<div style="text-align: left;">
<span style="font-family: Verdana, sans-serif; font-weight: bold; text-align: justify;"><u>Design Code:-</u></span>
</div>
<pre class="php" name="code"><asp:button id="btnSendreminder" onclick="SendMail_Click" runat="server" text="Send Reminder Mail">
</asp:button></pre>
<div style="text-align: left;">
<span style="font-family: Verdana, sans-serif; font-weight: bold; text-align: justify;"><u>Code Behind:-</u></span>
</div>
<pre class="php" name="code"> protected void SendMail_Click(object sender, EventArgs e)
{
cmd3 = new SqlCommand("select email from tbluser", con);
string email;
con.Open();
SqlDataReader dr=cmd3.ExecuteReader();
while(dr.Read())
{
email=dr[0].ToString();
MailMessage myMsg = new MailMessage();
myMsg.From = new MailAddress("*****@gmail.com");
myMsg.To.Add(email);
myMsg.Subject = "This is Reminder Mail to you";
myMsg.IsBodyHtml = true;
string currentyear = DateTime.Now.Year.ToString();
myMsg.Body = "<u>Dear Pay your Membership Fee.If Already Paid Ignore this mail";
myMsg.CC.Add("*********@gmail.com");
// your remote SMTP server IP.
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.Credentials = new System.Net.NetworkCredential("*******@gmail.com", "Password");
smtp.EnableSsl = true;
smtp.Send(myMsg);
lblmail.Text = "Mail Sent";
}
}
</pre>
</div>
</div>
</pre>
</div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-61693541811023429002014-01-01T01:33:00.000-08:002014-01-01T01:43:43.842-08:00Working with label Control and its Properties in Asp.net<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<pre name="code">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<u style="font-family: Verdana, sans-serif; font-weight: bold;">Description:-</u><span style="font-family: Verdana, sans-serif;"> A Label is used to display the text on the Page.Using TextBox and Button we can display the text from textbox into Label control</span><span style="background-color: #fcfcfc; color: #333333;"><span style="font-family: Verdana, sans-serif;">.The properties of labels are as follows</span></span><br />
<ul style="text-align: left;">
<li><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">AccessKey,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">Attributes,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">BackColor ,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">BorderColor,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">BorderStyle,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">BorderWidth,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">CssClass,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">Enabled,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">Font,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">EnableTheming,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">ForeColor,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">Height, </span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">IsEnabled,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">SkinID,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">Style,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">TabIndex,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">ToolTip,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">Width,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">EnableViewState,</span><span style="background-color: white; color: #444444; font-family: Verdana, sans-serif;">Visible,</span></li>
<li><span style="color: #444444; font-family: Verdana, sans-serif;">Now in this Example we need one Text Box,one Button and one Label to display the Text.</span></li>
</ul>
</div>
<div style="font-family: 'Times New Roman'; white-space: normal;">
<span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc; color: #333333;">
</span></span><span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc; color: #333333;">
</span></span><span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc;"><u style="color: #333333; font-weight: bold;">Demo:-</u><span style="color: #333333;"> </span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-rGq5TIuwg3rF52_NFByyoLESggu9DoNeN5dre78ByTp8cBM5fmwEVhS1Unskzgtgwca3vdbwFytXf4wZDIJA2iju-qv-Mczb0W7UnNvNqLkFJoDGk6O4u9pkGxbRJ0AYpL2E9JQKajA/s1600/Label.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-rGq5TIuwg3rF52_NFByyoLESggu9DoNeN5dre78ByTp8cBM5fmwEVhS1Unskzgtgwca3vdbwFytXf4wZDIJA2iju-qv-Mczb0W7UnNvNqLkFJoDGk6O4u9pkGxbRJ0AYpL2E9JQKajA/s1600/Label.gif" /></a></div>
<div class="separator" style="clear: both; color: #333333; font-family: 'Times New Roman'; text-align: center; white-space: normal;">
<span style="font-family: Verdana, sans-serif;"></span></div>
<div class="separator" style="clear: both; color: #333333; font-family: 'Times New Roman'; text-align: center; white-space: normal;">
<span style="font-family: Verdana, sans-serif;">
</span></div>
<div class="separator" style="clear: both; color: #333333; font-family: 'Times New Roman'; text-align: center; white-space: normal;">
<span style="font-family: Verdana, sans-serif;">
</span></div>
<div class="separator" style="clear: both; color: #333333; font-family: 'Times New Roman'; white-space: normal;">
<span style="font-family: Verdana, sans-serif;"><u style="font-weight: bold;">Design Code:-</u> </span></div>
<div class="separator" style="clear: both; color: #333333; font-family: 'Times New Roman'; white-space: normal;">
<span style="font-family: Verdana, sans-serif;">
</span></div>
</div>
</pre>
<pre class="php" name="code"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
</head><body>
<form runat="server">
<table>
<tr> <td> <asp:textbox id="TxTLabel" runat="server"></asp:textbox></td>
<td> <asp:label backcolor="DarkOrange" id="lbltext" runat="server"></asp:label> </td> </tr>
<tr> <td colspan="2"><center>
<asp:button id="btnlbl" onclick="BtnlblText" runat="server" text="Display"></asp:button></center>
</td></tr>
</table>
</form>
</body></html>
</pre>
<u style="color: #333333; font-family: Verdana, sans-serif; font-weight: bold; white-space: normal;"> Code Behind:-</u>
<br />
<div class="separator" style="clear: both; color: #333333; font-family: 'Times New Roman'; white-space: normal;">
<span style="font-family: Verdana, sans-serif;">
</span></div>
</div>
<pre class="php" name="code">public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void BtnlblText(object sender, EventArgs e)
{
lbltext.Text = TxTLabel.Text;
}
}
</pre>
</div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-19428764894387845342013-07-26T02:57:00.001-07:002013-07-26T03:00:13.580-07:00Change Menu Hover Styling in Asp.net<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;"><u style="font-weight: bold;">Description:-</u> In Previous articles We have learned <a href="http://aspdotnetstudio.blogspot.in/2013/06/range-validator-on-text-change-error.html" target="_blank">Range Validator</a> <span style="background-color: #fcfcfc; color: #333333;"><a href="http://aspdotnetstudio.blogspot.in/2013/05/validations-in-javascript-for-email-and.html" target="_blank">Email and Phone Number</a> , <a href="http://aspdotnetstudio.blogspot.in/2013/05/regular-expression-validator-for-url.html" target="_blank">Web Url Address Validation</a>. Now in this Article We Describe How to use Range Validator Between Two values.Now in this article we learn How to change Menu Style on hover.</span></span><br />
<span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc; color: #333333;"><br /></span></span>
<span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc; color: #333333;"><br /></span></span>
<span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc;"><u style="color: #333333; font-weight: bold;">Demo:-</u><span style="color: #333333;"> </span></span></span><br />
<div class="separator" style="clear: both; color: #333333; text-align: center;">
<span style="font-family: Verdana, sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjsve-4WXOgiahbuh11AOq7xqzRLUBgynAVatXUDiLUBuzEf8jUeUUtLmzLwYnTX7tDqqxd9R10lDJzAzxGg016TyTxparXIR5xgLBzerSOlGWEmQQP_mdTPQSIraN7MGP4HEqZ-vns_w/s1600/www.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjsve-4WXOgiahbuh11AOq7xqzRLUBgynAVatXUDiLUBuzEf8jUeUUtLmzLwYnTX7tDqqxd9R10lDJzAzxGg016TyTxparXIR5xgLBzerSOlGWEmQQP_mdTPQSIraN7MGP4HEqZ-vns_w/s1600/www.gif" /></a></span></div>
<div class="separator" style="clear: both; color: #333333; text-align: center;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; color: #333333; text-align: center;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; color: #333333; text-align: left;">
<span style="font-family: Verdana, sans-serif;"><u style="font-weight: bold;">Coding:-</u> </span></div>
<div class="separator" style="clear: both; color: #333333; text-align: left;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<blockquote class="tr_bq">
<blockquote>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head runat="server"><br /> <title></title><br /> <style type="text/css"><br /> <br /> #mnuMyWeb<br /> {<br /> background:darkgreen;<br /> border:groove 3px darkblue;<br /> }<br /> <br /> #mnuMyWeb a<br /> {<br /> border-right:solid 1px lightyellow;<br /> color:lightyellow;<br /> padding:5px 8px 5px 8px;<br /> display:inline-block;<br /> }<br /> <br /> #mnuMyWeb a:hover<br /> {<br /> background:lightyellow;<br /> color:darkgreen;<br /> }<br /> <br /> #mnuMyWeb a.active<br /> {<br /> background:darkblue;<br /> color:Red;<br /> }<br /> <br /> </style><br /></head><br /><body><br /> <form id="form1" runat="server"><br /> <div><br /> <asp:Menu ID="mnuMyWeb" Orientation="Horizontal" runat="server"><br /> <Items><br /> <asp:MenuItem Text="Home" Selected="true" NavigateUrl="~/Home.aspx" /><br /> <asp:MenuItem Text="About Us" NavigateUrl="~/AboutUs.aspx" /><br /> <asp:MenuItem Text="Services" NavigateUrl="#" /><br /> <asp:MenuItem Text="Contacts" NavigateUrl="#" /><br /> </Items><br /> </asp:Menu><br /> </div><br /> </form><br /></body><br /></html></blockquote>
<div>
<br /></div>
</blockquote>
</div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-91512455672965839112013-06-20T03:52:00.001-07:002013-06-20T03:52:10.062-07:00Range Validator on Text Change Error Message in Asp.net Validation<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;"><u style="font-weight: bold;">Description:-</u> In Asp.net <a href="http://aspdotnetstudio.blogspot.in/search/label/Validation" target="_blank">Validation</a> Now we started to cover All <a href="http://aspdotnetstudio.blogspot.in/search/label/Validation" target="_blank">Validations</a> used in Asp.net.In my previous Articles We done <a href="http://aspdotnetstudio.blogspot.in/2013/05/validations-in-javascript-for-email-and.html" target="_blank">Email and Phone Number</a> , <a href="http://aspdotnetstudio.blogspot.in/2013/05/regular-expression-validator-for-url.html" target="_blank">Web Url Address Validation</a>. Now in this Article We Describe How to use Range Validator Between Two values.So My friends here is the Demo How The Code Works..</span><br />
<br />
<br />
<b><u><span style="font-family: Verdana, sans-serif;">Demo:-</span></u></b><br />
<b><u><br /></u></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiINRfGHu8-sAJ7szt3nZ7xTc1yvW98G49pGBs7voB_iliKmaTSV_0WC54T6Z0owSMk-n39lt8H4u5RIDYn2EloP0tF2uQKRQPnsA5RLNnXH-cW_d65keZPRgZDa7mbbfn42sZ_vmpyfmA/s1600/age.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiINRfGHu8-sAJ7szt3nZ7xTc1yvW98G49pGBs7voB_iliKmaTSV_0WC54T6Z0owSMk-n39lt8H4u5RIDYn2EloP0tF2uQKRQPnsA5RLNnXH-cW_d65keZPRgZDa7mbbfn42sZ_vmpyfmA/s1600/age.gif" /></a></div>
<b><u><br /></u></b>
<b><u><br /></u></b>
<span style="font-family: Verdana, sans-serif;"><u style="font-weight: bold;">Coding:-</u> </span><br />
<br />
<blockquote class="tr_bq">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head runat="server"><br /> <title>Untitled Page</title><br /></head><br /><body><br /> <form id="form1" runat="server"><br /> <div><br /> <asp:Label ID="lblNum" runat="server">Enter age Between 18 to 28</asp:Label><br /> <br /> &nbsp;&nbsp;&nbsp;<br /> <br /> <asp:TextBox ID="txtage" runat="server" ></asp:TextBox><br /> <asp:RangeValidator runat="server" ID="rgvtxtage" ErrorMessage="Please Enter Age Between 18 to 28" MinimumValue="18" MaximumValue="28" Type="Integer" ControlToValidate="txtage"></asp:RangeValidator><br /> <br /> <br /> </div><br /> </form><br /></body><br /></html></blockquote>
<div>
<br /></div>
</div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-52053655659775096402013-06-14T09:56:00.005-07:002013-06-14T10:18:23.803-07:00Allow only Numbers in Textbox Using JavaScript.<div style="font-family: arial;">
<u style="background-color: white; color: #333333; font-family: Verdana, sans-serif; font-weight: bold; line-height: 20px; text-align: justify;">Description:-</u><span style="background-color: white; color: #333333; font-family: Verdana, sans-serif; line-height: 20px; text-align: justify;"> Dear Friends in My some previous article We Learned about <a href="http://aspdotnetstudio.blogspot.in/2013/06/only-letters-allowed-in-text-box-using.html" target="_blank">Only Alphabets allow in textbox in javaScript</a>, JQuery Javascript Some Tutorial Like as</span><a href="http://aspdotnetstudio.blogspot.in/2013/06/bouncing-navigation-menu-bar-easeout.html" style="background-color: white; color: #b31a1a; font-family: Verdana, sans-serif; line-height: 20px; outline: none; text-align: justify;" target="_blank"><b> easeOut Effect in JQuery</b></a><span style="background-color: white; color: #333333; font-family: Verdana, sans-serif; line-height: 20px; text-align: justify;">, </span><a href="http://aspdotnetstudio.blogspot.in/2013/06/how-to-make-slider-in-javascript-with.html" style="background-color: white; color: black; font-family: Verdana, sans-serif; line-height: 20px; outline: none; text-align: justify;" target="_blank">How To make Slider in JavaScript</a><span style="background-color: #fcfcfc; color: #333333; font-family: Verdana, sans-serif; line-height: 20px; text-align: justify;">,</span><a href="http://aspdotnetstudio.blogspot.in/2013/06/wait-for-downloading-or-click-here-to.html" style="background-color: white; color: black; font-family: Verdana, sans-serif; line-height: 20px; outline: none; text-align: justify;" target="_blank">Wait for Downloading Counter</a><span style="background-color: #fcfcfc; color: #333333; font-family: Verdana, sans-serif; line-height: 20px; text-align: justify;">,</span><a href="http://aspdotnetstudio.blogspot.in/2013/06/hightlight-searched-text-in-gridview.html" style="background-color: white; color: black; font-family: Verdana, sans-serif; line-height: 20px; outline: none; text-align: justify;" target="_blank">Highlight Searched Text in Gridview</a><span style="background-color: #fcfcfc; color: #333333; font-family: Verdana, sans-serif; line-height: 20px; text-align: justify;">,</span><a href="http://aspdotnetstudio.blogspot.in/2013/05/drop-down-menu-attached-with-selection.html" style="background-color: white; color: black; font-family: Verdana, sans-serif; line-height: 20px; outline: none; text-align: justify;" target="_blank">Dropdown list atteched with Selection of another DropDown</a><span style="background-color: #fcfcfc; color: #333333; font-family: Verdana, sans-serif; line-height: 20px; text-align: justify;"> </span><span style="background-color: #fcfcfc; color: #333333; font-family: Verdana, sans-serif; line-height: 20px; text-align: justify;">and many more Article on</span><span style="background-color: #fcfcfc; color: #333333; font-family: Verdana, sans-serif; line-height: 20px; text-align: justify;"> </span><a href="http://asp.net/" style="background-color: white; color: black; font-family: Verdana, sans-serif; line-height: 20px; outline: none; text-align: justify;">Asp.net</a><span style="background-color: #fcfcfc; color: #333333; font-family: Verdana, sans-serif; line-height: 20px; text-align: justify;">,</span><a href="http://aspdotnetstudio.blogspot.in/search/label/CSS" style="background-color: white; color: black; font-family: Verdana, sans-serif; line-height: 20px; outline: none; text-align: justify;" target="_blank">Css</a><span style="background-color: #fcfcfc; color: #333333; font-family: Verdana, sans-serif; line-height: 20px; text-align: justify;">,</span><a href="http://aspdotnetstudio.blogspot.in/search/label/Javascript" style="background-color: white; color: black; font-family: Verdana, sans-serif; line-height: 20px; outline: none; text-align: justify;" target="_blank">JavaScript</a><span style="background-color: #fcfcfc; color: #333333; font-family: Verdana, sans-serif; line-height: 20px; text-align: justify;">,</span><a href="http://aspdotnetstudio.blogspot.in/search/label/HTML" style="background-color: white; color: black; font-family: Verdana, sans-serif; line-height: 20px; outline: none; text-align: justify;" target="_blank">Html</a><span style="background-color: #fcfcfc; color: #333333; font-family: Verdana, sans-serif; line-height: 20px; text-align: justify;">,</span><a href="http://aspdotnetstudio.blogspot.in/search/label/JQUERY" style="background-color: white; color: black; font-family: Verdana, sans-serif; line-height: 20px; outline: none; text-align: justify;" target="_blank">Jquery</a><span style="background-color: #fcfcfc; color: #333333; font-family: Verdana, sans-serif; line-height: 20px; text-align: justify;">.Now In this Article We Learn That How to allow only Numbers in textbox Using JavaScript .</span></div>
<div style="font-family: arial;">
<u style="font-weight: bold;"><br /></u></div>
<div style="font-family: arial;">
<u style="font-weight: bold;">Demo:-</u><br />
<div class="separator" style="clear: both; font-size: small; font-weight: bold; text-align: center; text-decoration: underline;">
</div>
<div style="font-size: small;">
</div>
<div class="separator" style="clear: both; display: inline !important; font-size: small; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFPRsbBdraJT7mvR7m1vwm7jwzWjzEwef_KSwqXRmS1Av9xqhrxfYawpA27uDU49JK9zgiyl9h4CF84oFBWIK8fZ7O87gbxTeheagRQ7JPyWYXTpLtSirnovZPfhjcFpEg5rwBdrGa-wU/s1600/ra.gif" imageanchor="1" style="font-weight: bold; margin-left: 1em; margin-right: 1em; text-decoration: underline;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFPRsbBdraJT7mvR7m1vwm7jwzWjzEwef_KSwqXRmS1Av9xqhrxfYawpA27uDU49JK9zgiyl9h4CF84oFBWIK8fZ7O87gbxTeheagRQ7JPyWYXTpLtSirnovZPfhjcFpEg5rwBdrGa-wU/s1600/ra.gif" /></a></div>
<div class="separator" style="clear: both; font-size: small; font-weight: bold; text-align: center; text-decoration: underline;">
</div>
</div>
<div style="font-family: arial; font-size: small;">
<b><u><br /></u></b></div>
<div style="font-family: arial; font-size: small;">
<b><u>Coding:-</u></b></div>
<div style="font-family: arial; font-size: small;">
<br /></div>
<blockquote class="tr_bq">
<html><br />
<head><br />
<title>allwon only numbers in textbox using JavaScript</title><br />
<script language="Javascript" type="text/javascript"><br />
<br />
function NumberOnly(e, t) {<br />
try {<br />
if (window.event) {<br />
var charCode = window.event.keyCode;<br />
}<br />
else if (e) {<br />
var charCode = e.which;<br />
}<br />
else { return true; }<br />
if (charCode > 31 && (charCode < 48 || charCode > 57)) {<br />
return false;<br />
}<br />
return true;<br />
}<br />
catch (err) {<br />
alert(err.Description);<br />
}<br />
}<br />
<br />
</script><br />
</head><br />
<body><br />
<table align="center"><br />
<tr><br />
<td><br />
<input type="text" onkeypress="return NumberOnly(event,this);" /><br />
</td><br />
</tr><br />
</table><br />
</body><br />
</html></blockquote>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com2tag:blogger.com,1999:blog-3159271507854779946.post-1147910330769191902013-06-13T23:21:00.003-07:002013-06-13T23:21:30.102-07:00Only Letters allowed in text Box Using JavaScript.<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: Verdana, sans-serif;"><u style="font-weight: bold;">Description:-</u> Dear Friends in My some previous article We Learned about JQuery Javascript Some Tutorial Like as<a href="http://aspdotnetstudio.blogspot.in/2013/06/bouncing-navigation-menu-bar-easeout.html" style="color: #b31a1a; outline: none; text-decoration: none;" target="_blank"> easeOut Effect in JQuery</a>, <a href="http://aspdotnetstudio.blogspot.in/2013/06/how-to-make-slider-in-javascript-with.html" style="color: black; outline: none;" target="_blank">How To make Slider in JavaScript</a><span style="background-color: #fcfcfc;">,</span><a href="http://aspdotnetstudio.blogspot.in/2013/06/wait-for-downloading-or-click-here-to.html" style="color: black; outline: none;" target="_blank">Wait for Downloading Counter</a><span style="background-color: #fcfcfc;">,</span><a href="http://aspdotnetstudio.blogspot.in/2013/06/hightlight-searched-text-in-gridview.html" style="color: black; outline: none;" target="_blank">Highlight Searched Text in Gridview</a><span style="background-color: #fcfcfc;">,</span><a href="http://aspdotnetstudio.blogspot.in/2013/05/drop-down-menu-attached-with-selection.html" style="color: black; outline: none;" target="_blank">Dropdown list atteched with Selection of another DropDown</a><span style="background-color: #fcfcfc;"> </span><span style="background-color: #fcfcfc;">and many more Article on</span><span style="background-color: #fcfcfc;"> </span><a href="http://asp.net/" style="color: black; outline: none;">Asp.net</a><span style="background-color: #fcfcfc;">,</span><a href="http://aspdotnetstudio.blogspot.in/search/label/CSS" style="color: black; outline: none;" target="_blank">Css</a><span style="background-color: #fcfcfc;">,</span><a href="http://aspdotnetstudio.blogspot.in/search/label/Javascript" style="color: black; outline: none;" target="_blank">JavaScript</a><span style="background-color: #fcfcfc;">,</span><a href="http://aspdotnetstudio.blogspot.in/search/label/HTML" style="color: black; outline: none;" target="_blank">Html</a><span style="background-color: #fcfcfc;">,</span><a href="http://aspdotnetstudio.blogspot.in/search/label/JQUERY" style="color: black; outline: none;" target="_blank">Jquery</a><span style="background-color: #fcfcfc;">.Now In this Article We Learn That How to allowed only Alphabets in textbox Using JavaScript .</span></span></div>
<div style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc;"><br /></span></span></div>
<div style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc;"><br /></span></span></div>
<div style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc;"><b><u>Demo:-</u></b></span></span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4hSCNVyXcFtJCqq-i03dI4mQKsmg6NgWXeKyWLV70GDYtMDqFXAq6ZuwU8xIbznOTE48Xidq4RzXzwxs_VWWKTLpzKURaOdsDzoZv-liIjjFprCVMMQKhVlwcAOdBkaTW-VHXxBDWgvc/s1600/nnn.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4hSCNVyXcFtJCqq-i03dI4mQKsmg6NgWXeKyWLV70GDYtMDqFXAq6ZuwU8xIbznOTE48Xidq4RzXzwxs_VWWKTLpzKURaOdsDzoZv-liIjjFprCVMMQKhVlwcAOdBkaTW-VHXxBDWgvc/s1600/nnn.gif" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u>Coding:-</u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><br /></u></b></div>
<blockquote class="tr_bq">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head runat="server"><br /> <title>Aspdotnet Studio</title><br /> <script type="text/javascript"><br />function OnlyAlphabet(){<br /> if (!FrmText.Letters.value.match(/^[a-zA-Z]+$/) && FrmText.Letters.value !="")<br /> {<br /> FrmText.Letters.value="";<br /> FrmText.Letters.focus();<br /> alert("Only Alphabets Allowed");<br /> }<br />} <br /></script><br /> <br /> <br /> <br /> <br /></head><br /><body><br /> <br /><table align=center><br /><tr><td><form name="FrmText"><br />Enter Text: <input type="text" name="Letters" onkeyup="OnlyAlphabet()"><br /></form><br;><br /></td></tr><br /><script type="text/javascript">document.onload = ctck();</script><br /></td></tr><br /></table><br /></body><br /></html></blockquote>
<div class="separator" style="clear: both;">
</div>
<div>
<br /></div>
<div>
<span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc;"><br /></span></span></div>
</div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com1tag:blogger.com,1999:blog-3159271507854779946.post-80974186371366951642013-06-13T10:32:00.002-07:002013-06-13T10:32:34.124-07:00Show Hide Image Programmatically in Asp.net.<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<span style="font-family: Verdana, sans-serif;"><u style="font-weight: bold;">Description:-</u> Dear Friends in My some previous article We Learned about JQuery Javascript Some Tutorial Like as<a href="http://aspdotnetstudio.blogspot.in/2013/06/bouncing-navigation-menu-bar-easeout.html" target="_blank"> easeOut Effect in JQuery</a>, <a href="http://aspdotnetstudio.blogspot.in/2013/06/how-to-make-slider-in-javascript-with.html" style="color: black; outline: none;" target="_blank">How To make Slider in JavaScript</a><span style="background-color: #fcfcfc; color: #333333;">,</span><a href="http://aspdotnetstudio.blogspot.in/2013/06/wait-for-downloading-or-click-here-to.html" style="color: black; outline: none;" target="_blank">Wait for Downloading Counter</a><span style="background-color: #fcfcfc; color: #333333;">,</span><a href="http://aspdotnetstudio.blogspot.in/2013/06/hightlight-searched-text-in-gridview.html" style="color: black; outline: none;" target="_blank">Highlight Searched Text in Gridview</a><span style="background-color: #fcfcfc; color: #333333;">,</span><a href="http://aspdotnetstudio.blogspot.in/2013/05/drop-down-menu-attached-with-selection.html" style="color: black; outline: none;" target="_blank">Dropdown list atteched with Selection of another DropDown</a><span style="background-color: #fcfcfc; color: #333333;"> </span><span style="background-color: #fcfcfc; color: #333333;">and many more Article on</span><span style="background-color: #fcfcfc; color: #333333;"> </span><a href="http://asp.net/" style="color: black; outline: none;">Asp.net</a><span style="background-color: #fcfcfc; color: #333333;">,</span><a href="http://aspdotnetstudio.blogspot.in/search/label/CSS" style="color: black; outline: none;" target="_blank">Css</a><span style="background-color: #fcfcfc; color: #333333;">,</span><a href="http://aspdotnetstudio.blogspot.in/search/label/Javascript" style="color: black; outline: none;" target="_blank">JavaScript</a><span style="background-color: #fcfcfc; color: #333333;">,</span><a href="http://aspdotnetstudio.blogspot.in/search/label/HTML" style="color: black; outline: none;" target="_blank">Html</a><span style="background-color: #fcfcfc; color: #333333;">,</span><a href="http://aspdotnetstudio.blogspot.in/search/label/JQUERY" style="color: black; outline: none;" target="_blank">Jquery</a><span style="background-color: #fcfcfc; color: #333333;">.Now In this Article We Learn That how to Show hide Image or any other control programmatically in Asp.net.</span></span></div>
<div style="text-align: justify;">
<span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc; color: #333333;"><br /></span></span></div>
<div style="text-align: justify;">
<span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc; color: #333333;"><b><u><br /></u></b></span></span></div>
<div style="text-align: justify;">
<span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc; color: #333333;"><b><u>Demo:-</u></b></span></span></div>
<div style="text-align: justify;">
<span style="font-family: Verdana, sans-serif;"><span style="background-color: #fcfcfc; color: #333333;"><b><u><br /></u></b></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh92fmTlAc4zG7SI1SnJGQZO8Xpu0OTcvbnHe50f58N9nAyEZArVYngfEK4At4S2B2hHzmZj47rOOTnBvWve0VzP4iJ0_u6wSlQcixBOlfeDCCCsMhjLGT_npZewm7ok67Ou8dkia6rerI/s1600/qqqqq.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh92fmTlAc4zG7SI1SnJGQZO8Xpu0OTcvbnHe50f58N9nAyEZArVYngfEK4At4S2B2hHzmZj47rOOTnBvWve0VzP4iJ0_u6wSlQcixBOlfeDCCCsMhjLGT_npZewm7ok67Ou8dkia6rerI/s1600/qqqqq.gif" height="320" width="275" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u>Coding:-</u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><br /></u></b></div>
<blockquote class="tr_bq">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br /> <br /><script runat="server"> <br /> protected void Button1_Click(object sender, System.EventArgs e) <br /> {<br /> Image1.Visible = false; <br /> } <br /> protected void Button2_Click(object sender, System.EventArgs e) <br /> {<br /> Image1.Visible = true;<br /> } <br /></script> <br /> <br /><html xmlns="http://www.w3.org/1999/xhtml"> <br /><head id="Head1" runat="server"> <br /> <title>How to show, hide, visible TextBox programmatically</title> <br /></head> <br /><body> <br /> <form id="form1" runat="server"> <br /> <div> <br /> <h2 style=" background-color:orange; color :white; width: 321px; height: 27px;">Show Hide controls in Asp.net </h2> <br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> <br /> <asp:Image ID="Image1" runat="server" ImageUrl="~/1.jpg" Height="281px"<br /> Width="274px" /><br /> <br /><br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> <asp:Button <br /> ID="Button1" <br /> runat="server" BackColor="OrangeRed" <br /> ForeColor="White" <br /> Text="Hide Love" <br /> OnClick="Button1_Click" <br /> Font-Bold="true" <br /> /> <br /> <asp:Button <br /> ID="Button2" <br /> runat="server" BackColor="OrangeRed" <br /> Font-Bold="true" <br /> ForeColor="White" <br /> Text="Show Love" <br /> OnClick="Button2_Click" <br /> /> <br /> </div> <br /> </form> <br /></body> <br /></html> </blockquote>
<div class="separator" style="clear: both;">
</div>
<div>
<br /></div>
</div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-73675651098886340532013-06-12T05:14:00.002-07:002013-06-12T05:14:17.227-07:00Bouncing Navigation Menu Bar easeOut Effect using Jquery in Asp.net.<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;"><u style="font-weight: bold;">Description:-</u> Dear Friends in my previous Article of Jquery We learn <a href="http://aspdotnetstudio.blogspot.in/2013/05/zoom-out-zoom-in-using-jquery-in-aspnet.html" target="_blank">How to </a><span style="background-color: #fcfcfc; color: #333333;"><a href="http://aspdotnetstudio.blogspot.in/2013/05/zoom-out-zoom-in-using-jquery-in-aspnet.html" target="_blank">Zoom Out & Zoom In Using JQuery in Asp.net</a> and<a href="http://aspdotnetstudio.blogspot.in/2013/05/jquery-show-hide-option-theme-change.html" target="_blank"> J</a></span><span style="background-color: #fcfcfc; color: #333333;"><a href="http://aspdotnetstudio.blogspot.in/2013/05/jquery-show-hide-option-theme-change.html" target="_blank">Query Show Hide Option Theme Change & Using Buttons</a>,Now in this article we learn How to make </span><span style="color: #333333;">Bouncing Navigation Menu Bar easeOut Effect using Jquery in <a href="http://asp.net/">Asp.net</a>.</span></span><br />
<span style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="color: #333333; font-family: Verdana, sans-serif;"><b><u>Demo:-</u></b></span><br />
<span style="color: #333333; font-family: Verdana, sans-serif;"><b><u><br /></u></b></span>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGhS3AgGqw5gwFzrCheQLu9WTN-Aj-9fePsPZnJmNtXy0yXTostpi2PXKYRtZ4CnQHLlVHhBi9b8fOCuoT3lD6ObFHRe3ieS7FtUxFmmtCSRbYRXwQ0mvXJs5NQStIX1g23wr4o2Xy_Ww/s1600/awawa.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGhS3AgGqw5gwFzrCheQLu9WTN-Aj-9fePsPZnJmNtXy0yXTostpi2PXKYRtZ4CnQHLlVHhBi9b8fOCuoT3lD6ObFHRe3ieS7FtUxFmmtCSRbYRXwQ0mvXJs5NQStIX1g23wr4o2Xy_Ww/s1600/awawa.gif" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><span style="font-family: Verdana, sans-serif;">Coding:-</span></u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><span style="font-family: Verdana, sans-serif;"><br /></span></u></b></div>
<blockquote class="tr_bq">
<b><u><span style="font-family: Verdana, sans-serif;"><br /></span></u></b><span style="font-family: Verdana, sans-serif;"><%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %></span><span style="font-family: Verdana, sans-serif;"><br /></span><span style="font-family: Verdana, sans-serif;"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></span><span style="font-family: Verdana, sans-serif;"><br /></span><span style="font-family: Verdana, sans-serif;"><html xmlns="http://www.w3.org/1999/xhtml"></span><span style="font-family: Verdana, sans-serif;"><head></span><span style="font-family: Verdana, sans-serif;"><title>jQuery Menu with Bounce Effect</title></span><span style="font-family: Verdana, sans-serif;"><script src="http://code.jquery.com/jquery-1.8.2.js" type="text/javascript"></script></span><span style="font-family: Verdana, sans-serif;"><script type="text/javascript" src="http://dev.css-zibaldone.com/js/jquery/plugins/jquery.easing.js"></script></span><span style="font-family: Verdana, sans-serif;"><script type="text/javascript"></span><span style="font-family: Verdana, sans-serif;">$(function () {</span><span style="font-family: Verdana, sans-serif;">$('li', '#navigation').each(function () {</span><span style="font-family: Verdana, sans-serif;">var $jli = $(this);</span><span style="font-family: Verdana, sans-serif;">var $a = $('a', $jli);</span><span style="font-family: Verdana, sans-serif;">$a.hover(function () {</span><span style="font-family: Verdana, sans-serif;">$a.stop(true, true).animate({</span><span style="font-family: Verdana, sans-serif;">height: '3em',</span><span style="font-family: Verdana, sans-serif;">lineHeight: '3em',</span><span style="font-family: Verdana, sans-serif;">bottom: '1em'</span><span style="font-family: Verdana, sans-serif;">}, 'slow', 'easeOutBounce');</span><span style="font-family: Verdana, sans-serif;">}, function () {</span><span style="font-family: Verdana, sans-serif;">$a.stop(true, true).animate({</span><span style="font-family: Verdana, sans-serif;">height: '2em',</span><span style="font-family: Verdana, sans-serif;">lineHeight: '2em',</span><span style="font-family: Verdana, sans-serif;">bottom: 0</span><span style="font-family: Verdana, sans-serif;">}, 'slow', 'easeOutBounce');</span><span style="font-family: Verdana, sans-serif;">});</span><span style="font-family: Verdana, sans-serif;">});</span><span style="font-family: Verdana, sans-serif;">});</span><span style="font-family: Verdana, sans-serif;"></script></span><span style="font-family: Verdana, sans-serif;"><style type="text/css"></span><span style="font-family: Verdana, sans-serif;">#navigation {</span><span style="font-family: Verdana, sans-serif;">height: 4em;</span><span style="font-family: Verdana, sans-serif;">margin: 0;</span><span style="font-family: Verdana, sans-serif;">padding: 0 1em;</span><span style="font-family: Verdana, sans-serif;">list-style: none;</span><span style="font-family: Verdana, sans-serif;">border-bottom: 2px solid #0270BF;</span><span style="font-family: Verdana, sans-serif;">}</span><span style="font-family: Verdana, sans-serif;">#navigation li {</span><span style="font-family: Verdana, sans-serif;">height: 100%;</span><span style="font-family: Verdana, sans-serif;">float: left;</span><span style="font-family: Verdana, sans-serif;">margin-right: 0.5em;</span><span style="font-family: Verdana, sans-serif;">}</span><span style="font-family: Verdana, sans-serif;">#navigation a {</span><span style="font-family: Verdana, sans-serif;">float: left;</span><span style="font-family: Verdana, sans-serif;">height: 2em;</span><span style="font-family: Verdana, sans-serif;">padding: 0 1em;</span><span style="font-family: Verdana, sans-serif;">background: #0270BF;</span><span style="font-family: Verdana, sans-serif;">color: #fff;</span><span style="font-family: Verdana, sans-serif;">line-height: 2;</span><span style="font-family: Verdana, sans-serif;">text-transform: uppercase;</span><span style="font-family: Verdana, sans-serif;">font-weight: bold;</span><span style="font-family: Verdana, sans-serif;">text-decoration: none;</span><span style="font-family: Verdana, sans-serif;">margin: 2em 0 0 0;</span><span style="font-family: Verdana, sans-serif;">letter-spacing: 0.1em;</span><span style="font-family: Verdana, sans-serif;">position: relative;</span><span style="font-family: Verdana, sans-serif;">}</span><span style="font-family: Verdana, sans-serif;">#navigation a:hover {</span><span style="font-family: Verdana, sans-serif;">background: #F86000;</span><span style="font-family: Verdana, sans-serif;">}</span><span style="font-family: Verdana, sans-serif;"></style></span><span style="font-family: Verdana, sans-serif;"></head></span><span style="font-family: Verdana, sans-serif;"><body></span><span style="font-family: Verdana, sans-serif;"><div></span><span style="font-family: Verdana, sans-serif;"><ul id="navigation"></span><span style="font-family: Verdana, sans-serif;"><li><a href="#">Asp.Net</a></li></span><span style="font-family: Verdana, sans-serif;"><li><a href="#">Jquery</a></li></span><span style="font-family: Verdana, sans-serif;"><li><a href="#">CSS</a></li></span><span style="font-family: Verdana, sans-serif;"></ul></span><span style="font-family: Verdana, sans-serif;"></div></span><span style="font-family: Verdana, sans-serif;"></body></span><span style="font-family: Verdana, sans-serif;"></html></span></blockquote>
<div class="separator" style="clear: both;">
<span style="font-family: Verdana, sans-serif;"></span></div>
<div>
<br /></div>
<span style="color: #333333; font-family: Verdana, sans-serif;"><b><u><br /></u></b></span></div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-65371828890257812402013-06-11T10:16:00.004-07:002013-06-11T10:16:57.319-07:00How to make A Calculator in JavaScript <div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;"><u style="font-weight: bold;">Description:-</u> In My Previous Article I Explained About <a href="http://aspdotnetstudio.blogspot.in/2013/06/how-to-make-slider-in-javascript-with.html" target="_blank">How To make Slider in JavaScript</a>,<a href="http://aspdotnetstudio.blogspot.in/2013/06/wait-for-downloading-or-click-here-to.html" target="_blank">Wait for Downloading Counter</a>,<a href="http://aspdotnetstudio.blogspot.in/2013/06/hightlight-searched-text-in-gridview.html" target="_blank">Highlight Searched Text in Gridview</a>,<a href="http://aspdotnetstudio.blogspot.in/2013/05/drop-down-menu-attached-with-selection.html" target="_blank">Dropdown list atteched with Selection of another DropDown</a> and many more Article on <a href="http://asp.net/">Asp.net</a>,<a href="http://aspdotnetstudio.blogspot.in/search/label/CSS" target="_blank">Css</a>,<a href="http://aspdotnetstudio.blogspot.in/search/label/Javascript" target="_blank">JavaScript</a>,<a href="http://aspdotnetstudio.blogspot.in/search/label/HTML" target="_blank">Html</a>,<a href="http://aspdotnetstudio.blogspot.in/search/label/JQUERY" target="_blank">Jquery</a>.Now in this article i will Explain How to create a Calculater using <a href="http://aspdotnetstudio.blogspot.in/search/label/Javascript" target="_blank">JavaScript</a>,</span><br />
<br />
<br />
<b><u><span style="font-family: Verdana, sans-serif;">Demo:-</span></u></b><br />
<b><u><br /></u></b>
<b><u><br /></u></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBi6vLbbHj76x4V_Xfhq9v7TBpCLJFGAUTjHMQk638htaoZcW_WEltrUbwh6yTRgP3Ni_fsubyPebubtmUcr3O-iU3cFsKuPrcJRGa5cJZx_Pn8for1bxjzDsMRIf2BVS16n0wjUKR4tI/s1600/wwww.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBi6vLbbHj76x4V_Xfhq9v7TBpCLJFGAUTjHMQk638htaoZcW_WEltrUbwh6yTRgP3Ni_fsubyPebubtmUcr3O-iU3cFsKuPrcJRGa5cJZx_Pn8for1bxjzDsMRIf2BVS16n0wjUKR4tI/s1600/wwww.gif" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><span style="font-family: Verdana, sans-serif;">Coding:-</span></u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><span style="font-family: Verdana, sans-serif;"><br /></span></u></b></div>
<blockquote class="tr_bq">
<span style="font-family: Verdana, sans-serif;"><html><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><head><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><title>On Page Javascript</title><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript" language="javascript"><br /><span class="Apple-tab-span" style="white-space: pre;"> </span>function calc()<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>var v1 = document.getElementById("txtV1").value;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>var v2 = document.getElementById("txtV2").value;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>var op = document.getElementById("selOperator");<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>op = op.options[op.selectedIndex].value;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>if(chkNumeric(v1)&&chkNumeric(v2))<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>var lbl = document.getElementById("lblAnswer");<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>if(op == '+')<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>lbl.innerHTML = parseFloat(v1) + parseFloat(v2);<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>else if(op == '-')<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>lbl.innerHTML = parseFloat(v1) - parseFloat(v2);<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>else if(op == '*')<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>lbl.innerHTML = parseFloat(v1) * parseFloat(v2);<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>else if(op == '/')<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>lbl.innerHTML = parseFloat(v1) / parseFloat(v2);<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>else<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>if(!chkNumeric(v1) && !chkNumeric(v2)) alert("Please enter Numeric Values in both Boxes.");<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>else if (!chkNumeric(v1)) alert("Please enter a Numeric Value in First Box.");<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>else if(!chkNumeric(v2)) alert("Please enter a Numeric Value in Second Box.");<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>function chkNumeric(v)<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>var isvalid = true;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>var validletters = "0123456789.";<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>for(i=0;i<v.length;i++)<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>if(validletters.indexOf(v.charAt(i),0)<0)<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>isvalid = false;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>break;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>return isvalid;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span></script><br /><span class="Apple-tab-span" style="white-space: pre;"> </span></head><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><body><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><input type="text" id="txtV1"/>&nbsp;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><select id="selOperator"><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><option selected="selected" value="+">+</option><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><option value="-">-</option><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><option value="*">x</option><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><option value="/">/</option><br /><span class="Apple-tab-span" style="white-space: pre;"> </span></select>&nbsp;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><input type="text" id="txtV2"/>&nbsp;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><input type="button" value="=" onclick="calc()"/>&nbsp;&nbsp;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><label id="lblAnswer"></label><br /><span class="Apple-tab-span" style="white-space: pre;"> </span></body><br /></html></span></blockquote>
<div class="separator" style="clear: both;">
</div>
<b><u><br /></u></b></div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-71240921882333982922013-06-09T00:32:00.002-07:002013-06-09T00:32:42.332-07:00How to make slider in JavaScript with equal time Difference.<div class="tr_bq">
<b><u>Demo:-</u></b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv2Du7eqoh0RWnbbfzP5HiJmX0RKmOtGht-rXdExDjwitJgd2Ac-3HXHCojomVjso_KQmNVvfd6CSnF4eL863KHsm9UgxuQyOCTrSImDamG294M7waif0AxIxF-PkWKmEajtjHzGNg_F0/s1600/slll.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv2Du7eqoh0RWnbbfzP5HiJmX0RKmOtGht-rXdExDjwitJgd2Ac-3HXHCojomVjso_KQmNVvfd6CSnF4eL863KHsm9UgxuQyOCTrSImDamG294M7waif0AxIxF-PkWKmEajtjHzGNg_F0/s1600/slll.gif" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<u style="font-weight: bold;">About:-</u> In the previous Article We Learn how <a href="http://aspdotnetstudio.blogspot.in/2013/06/wait-for-downloading-or-click-here-to.html" target="_blank">Wait time counter</a> in <a href="http://aspdotnetstudio.blogspot.in/search/label/Javascript" target="_blank">JavaScript</a> And Now in this Article We Learn How to make a simple slider using <a href="http://aspdotnetstudio.blogspot.in/search/label/Javascript" target="_blank">JavaScript</a>.You can increase or decrease the time to change the speed of Image in the <a href="http://aspdotnetstudio.blogspot.in/" target="_blank">code</a>.Please just change the images and add your image to the coding.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u>Coding:-</u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><br /></u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><br /></u></b></div>
<blockquote>
<html><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><head><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><title>Slider</title><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript" language="javascript"><br /><span class="Apple-tab-span" style="white-space: pre;"> </span>function startslider(imgindex)<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>var arrImages = new Array('1.jpg','2.jpg','3.jpg','4.jpg','5.jpg');<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>var arrAlts = new Array('Alt1','Alt2','Alt3','Alt4','Alt5');<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>var imge = document.getElementById("imgSlider");<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>imge.src = 'images/' + arrImages[imgindex];<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>imge.alt = arrAlts[imgindex];<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>if(imgindex == 4) imgindex = 0;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>else imgindex++;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>setTimeout('startslider(' + imgindex +')',1000);<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span></script><br /><span class="Apple-tab-span" style="white-space: pre;"> </span></head><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><body onload="startslider(0)"><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><img src="" alt="" id="imgSlider" style="width:480px;height:220px;border:solid 2px black;"/><br /><span class="Apple-tab-span" style="white-space: pre;"> </span></body><br /></html></blockquote>
<div class="separator" style="clear: both;">
</div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-28888843354449947442013-06-08T00:46:00.000-07:002013-06-08T00:46:14.730-07:00Wait for Downloading Or Click Here To Download Counter in JavaScript.<div class="tr_bq">
<u style="font-weight: bold;">Demo:-</u> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfC373pFjA_aJkY6DD3FLRE200dwo6DcuPeer0sO-3Q_v3wnxX8zMu7pzbkxjpehV8Pli2xc5vOkoAwIMsQNrfMU0OJS03-dXogIySkeKqkXS7ZKwJHJ2pn7vUbKjGU2YpExYECFfCbsk/s1600/kjnkjnkj.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfC373pFjA_aJkY6DD3FLRE200dwo6DcuPeer0sO-3Q_v3wnxX8zMu7pzbkxjpehV8Pli2xc5vOkoAwIMsQNrfMU0OJS03-dXogIySkeKqkXS7ZKwJHJ2pn7vUbKjGU2YpExYECFfCbsk/s1600/kjnkjnkj.gif" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<u style="font-weight: bold;">About:-</u> In Previous Article I Write About How to Highlight Searched Text In <a href="http://aspdotnetstudio.blogspot.in/search/label/Grid%20View" target="_blank">Gridview</a> . In this Article using <a href="http://aspdotnetstudio.blogspot.in/search/label/Javascript" target="_blank">JavaScript </a> Learn How to create time wait Counter for downloading anything.</div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><br /></u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u>Coding:-</u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><br /></u></b></div>
<blockquote>
<html><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><head><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><title>Counter Example</title><br /><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript" language="javascript"><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>function startcounter(s)<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>var de = document.getElementById("dCounter");<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>de.innerHTML = 'Please Wait For<br>' + s + '<br>Seconds';<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>if(s == 0)<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>document.getElementById("dAd").style.display = 'none';<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>document.getElementById("dDownload").style.display = 'block';<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>else<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>s--;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>setTimeout('startcounter(' + s + ')',500);<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>function hidedcounter()<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>document.getElementById("dCounter").style.display = 'none';<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br /><span class="Apple-tab-span" style="white-space: pre;"> </span></script><br /><span class="Apple-tab-span" style="white-space: pre;"> </span></head><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><body onload="startcounter(10)"><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><center><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><div id="dCounter" style="font:bold 30px verdana;"></div><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><br><br><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><div id="dAd"><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><img src="hydrangeas.jpg" width="300" height="300" border="1" alt="Advertisement"/><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><br><br><br /><span class="Apple-tab-span" style="white-space: pre;"> </span>Or <br><a href="#" onclick="startcounter(0),hidedcounter()">Click Here</a><br /><span class="Apple-tab-span" style="white-space: pre;"> </span></div><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><div id="dDownload" style="display:none;"><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><input type="button" value="Download"/><br /><span class="Apple-tab-span" style="white-space: pre;"> </span></div><br /><span class="Apple-tab-span" style="white-space: pre;"> </span></center><br /><span class="Apple-tab-span" style="white-space: pre;"> </span></body><br /></html></blockquote>
<div class="separator" style="clear: both;">
</div>
<br />My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-74678090850151017352013-06-04T23:06:00.000-07:002013-06-04T23:06:23.072-07:00Hightlight Searched Text In Gridview Using Asp.net<b><u>Demo:-</u></b><br />
<b><u><br /></u></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP8_PLHO7hJls-02RMEL5L3mmeoWOu6vdz5YfkTbHbOJydJ3OmkJxD4rQRIamZhMRrXzhCnrLsSzQGYWpMmajspRF8pXPzxIs9J_tZMUPcE79ojfTWPrkBTF6NrLJIG3GQDUAMekiqZq0/s1600/qqqqq.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP8_PLHO7hJls-02RMEL5L3mmeoWOu6vdz5YfkTbHbOJydJ3OmkJxD4rQRIamZhMRrXzhCnrLsSzQGYWpMmajspRF8pXPzxIs9J_tZMUPcE79ojfTWPrkBTF6NrLJIG3GQDUAMekiqZq0/s1600/qqqqq.gif" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<u style="font-weight: bold;">Instruction:-</u> To Execute this code Firstly Create the table using these fields below</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDCpg396eyvN1LD0qmuzMPuXofeAnRQX4VhaF5gfBPQ0dgMqvjMaKrd_ms_1k1V5YfB23Z9C7eR96i_50Nfe6UaYOj3wWD3J4Ix5zZ6CVH9hmICXBpuw7UKfD2VzPTw8nUkuYhZGC24MA/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDCpg396eyvN1LD0qmuzMPuXofeAnRQX4VhaF5gfBPQ0dgMqvjMaKrd_ms_1k1V5YfB23Z9C7eR96i_50Nfe6UaYOj3wWD3J4Ix5zZ6CVH9hmICXBpuw7UKfD2VzPTw8nUkuYhZGC24MA/s1600/Untitled.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And add the data to the Table.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u>Design Code:-</u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><br /></u></b></div>
<blockquote class="tr_bq">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head id="Head1" runat="server"><br /><title>Highlight the Search Keywords in Gridview </title><br /><style type="text/css"><br />.GridviewDiv {font-size: 100%; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helevetica, sans-serif; color: #303933;}<br />Table.Gridview{border:solid 1px #df5015;}<br />.Gridview th{color:#FFFFFF;border-right-color:#abb079;border-bottom-color:#abb079;padding:0.5em 0.5em 0.5em 0.5em;text-align:center} <br />.Gridview td{border-bottom-color:#f0f2da;border-right-color:#f0f2da;padding:0.5em 0.5em 0.5em 0.5em;}<br />.Gridview tr{color: Black; background-color: White; text-align:left}<br />:link,:visited { color: #DF4F13; text-decoration:none }<br />.highlight {text-decoration: none;color:black;background:yellow;}<br /></style><br /></head><br /><body><br /><form id="form1" runat="server"><br /><div class="GridviewDiv"><br /><p><br />Author Name:<br /><asp:TextBox ID="txtSearch" runat="server" />&nbsp;&nbsp;<br /><asp:ImageButton ID="btnSearch" ImageUrl="~/SearchButton.png" runat="server"<br />Style="top: 5px; position: relative" onclick="btnSearch_Click" />&nbsp;&nbsp;<br /><asp:ImageButton ID="btnClear" ImageUrl="~/Clearbutton.png" runat="server" Style="top: 5px;<br />position: relative" onclick="btnClear_Click" /><br /><br /><br /><br /></p><br /><asp:GridView ID="gvDetails" runat="server" AutoGenerateColumns="False" AllowPaging="True"<br />AllowSorting="true" DataSourceID="dsDetails" Width="540px" PageSize="10" CssClass="Gridview" ><br /><HeaderStyle BackColor="SkyBlue" /><br /><Columns><br /><asp:TemplateField HeaderText="Author"><br /><ItemTemplate><br /><asp:Label ID="lblAuthor" Text='<%# HighlightText(Eval("Author").ToString()) %>' runat="server"/><br /></ItemTemplate><br /></asp:TemplateField><br /><asp:TemplateField HeaderText="Category"><br /><ItemTemplate><br /><asp:Label ID="lblCategory" Text='<%# Eval("Category") %>' runat="server"/><br /></ItemTemplate><br /></asp:TemplateField><br /><asp:TemplateField HeaderText="Country"><br /><ItemTemplate><br /><asp:Label ID="lblCountry" Text='<%#Eval("Country") %>' runat="server"></asp:Label><br /></ItemTemplate><br /></asp:TemplateField><br /></Columns><br /></asp:GridView><br /></div><br /><asp:SqlDataSource ID="dsDetails" runat="server" ConnectionString="<%$ConnectionStrings:dbconnection %>" SelectCommand="select * from TableU" FilterExpression="Author LIKE '%{0}%'"><br /><FilterParameters><br /><asp:ControlParameter Name="Author" ControlID="txtSearch" PropertyName="Text" /><br /></FilterParameters><br /></asp:SqlDataSource><br /></form><br /></body><br /></html<b style="text-decoration: underline;">></b></blockquote>
<b><u><br /></u></b>
<b><u>CodeBehind:- </u></b><br />
<b><u><br /></u></b>
<blockquote class="tr_bq">
using System;<br />using System.Text.RegularExpressions;<br />using System.Web.UI;<br /><br />public partial class _Default : System.Web.UI.Page<br />{<br />// Create a String to store our search results<br />private string SearchString = "";<br />protected void Page_Load(object sender, EventArgs e)<br />{<br />}<br />public string HighlightText(string InputTxt)<br />{<br />string Search_Str = txtSearch.Text;<br />// Setup the regular expression and add the Or operator.<br />Regex RegExp = new Regex(Search_Str.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase);<br />// Highlight keywords by calling the<br />//delegate each time a keyword is found.<br />return RegExp.Replace(InputTxt, new MatchEvaluator(ReplaceKeyWords));<br />}<br />public string ReplaceKeyWords(Match m)<br />{<br />return ("<span class=highlight>" + m.Value + "</span>");<br />}<br />protected void btnSearch_Click(object sender, ImageClickEventArgs e)<br />{<br />// Set the value of the SearchString so it gets<br />SearchString = txtSearch.Text;<br />}<br />protected void btnClear_Click(object sender, ImageClickEventArgs e)<br />{<br />// Simple clean up text to return the Gridview to it's default state<br />txtSearch.Text = "";<br />SearchString = "";<br />gvDetails.DataBind();<br />}<br />}</blockquote>
<br />
<div>
<br /></div>
<div class="separator" style="clear: both;">
</div>
<b><u><br /></u></b>My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-46201409421292112422013-05-30T01:17:00.000-07:002013-05-30T03:06:47.001-07:00Drop Down List Attached With Selection Of Another Drop Down Like Country,State,City Selection<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="tr_bq">
<b><u>Demo:-</u></b></div>
<b><u><br /></u></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMURx_Il0yA6u1Kn1PJhoWhMcTIPG7_b2YQE2RjGl0yrVgPJHoz3lGtWHewqaigdZjVF6L828OYrCGJTofJjPTzmDlnAER4xFt-aK1TpCQVNg6Nh57A0qxBDKmzp887eCy0YyhLad3utk/s1600/zzzzz.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMURx_Il0yA6u1Kn1PJhoWhMcTIPG7_b2YQE2RjGl0yrVgPJHoz3lGtWHewqaigdZjVF6L828OYrCGJTofJjPTzmDlnAER4xFt-aK1TpCQVNg6Nh57A0qxBDKmzp887eCy0YyhLad3utk/s1600/zzzzz.gif" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<u style="font-weight: bold;">Instruction:-</u> To Execute this code first of all make three table in a Database.which are are connected to each other with unique id.Simply make three tables like this..</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>CountryTable</b> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnpvPU1i3nsaZDjvjoDz1C0gu0_2g881P1rfhAiRw6V9hOc3QWNsGwuEE7QYaMWeXAysR5GM783WquEBICsTmnIszP9hecavC2NQxVftT5x_c1g0nYjJ8ScpIORGejc43tVWIr8aIQ_PI/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnpvPU1i3nsaZDjvjoDz1C0gu0_2g881P1rfhAiRw6V9hOc3QWNsGwuEE7QYaMWeXAysR5GM783WquEBICsTmnIszP9hecavC2NQxVftT5x_c1g0nYjJ8ScpIORGejc43tVWIr8aIQ_PI/s1600/1.png" /></a></div>
<b><u><br /></u></b>
<b>StateTable </b><br />
<div class="separator" style="clear: both; text-align: center;">
<b><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAPFUPxxiSBtZ3NzKv4U5nLhg-_t6_bKn0p9ryHSFRTi034akmJcDA9c7dzsteNYe2xs05NaXW6DFCxVnKeprXNF1eMAQ4BalNVCN8T83M-oWN666BbDLrXUzsmPKZH9Pgt7WRQSZ5Ui4/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAPFUPxxiSBtZ3NzKv4U5nLhg-_t6_bKn0p9ryHSFRTi034akmJcDA9c7dzsteNYe2xs05NaXW6DFCxVnKeprXNF1eMAQ4BalNVCN8T83M-oWN666BbDLrXUzsmPKZH9Pgt7WRQSZ5Ui4/s1600/2.png" /></a></b></div>
<div class="separator" style="clear: both; text-align: center;">
<b><br /></b></div>
<div class="separator" style="clear: both; text-align: center;">
<b><br /></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b>CityTable </b></div>
<div class="separator" style="clear: both; text-align: center;">
<b><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP5GidVdlmyrU-T7JDH_BMsSJdvxiHzN8VDQ3BMq1EOt4FRZDmrPPoQgZ2d4yFlyePdZuHAgKlB78qsfzAKCUn6gRXGSJsXfIKvn6MvFIZKNmWc_Ult3US60XBzVsep2rdjisspWHxtWg/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP5GidVdlmyrU-T7JDH_BMsSJdvxiHzN8VDQ3BMq1EOt4FRZDmrPPoQgZ2d4yFlyePdZuHAgKlB78qsfzAKCUn6gRXGSJsXfIKvn6MvFIZKNmWc_Ult3US60XBzVsep2rdjisspWHxtWg/s1600/3.png" /></a></b></div>
<br />
<b><u><br /></u></b>
And now these are design & code Behind Paste this code in your file<br />
<br />
<b><u>Design Code:-</u></b><br />
<b><u><br /></u></b>
<br />
<blockquote class="tr_bq">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CountryDropdowns.aspx.cs" Inherits="CountryDropdowns" %><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<head runat="server"><br />
<title>CasCading Dropdowns Sample</title><br />
<style type="text/css"><br />
.style1<br />
{<br />
height: 30px;<br />
}<br />
</style><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<table align="center" cellpadding="10px" cellspacing="5" style="background:skyblue;width:400px;border:solid 2px darkred;padding:8px;"><br />
<tr><br />
<td colspan="2" valign="bottom" class="style1"><br />
<h3>Drop Down Menu Attached With Selection Of One Another</h3> <hr /><br />
</td><br />
</tr><br />
<tr><br />
<td><br />
Select Country:<br />
</td><br />
<td><br />
<asp:DropDownList ID="ddlCountry" runat="server" AutoPostBack="true"<br />
onselectedindexchanged="ddlCountry_SelectedIndexChanged" Height="16px"<br />
Width="119px"></asp:DropDownList><br />
</td><br />
</tr><br />
<tr><br />
<td><br />
Select State:<br />
</td><br />
<td><br />
<asp:DropDownList ID="ddlState" runat="server" AutoPostBack="true"<br />
onselectedindexchanged="ddlState_SelectedIndexChanged" Height="18px" Width="122px"></asp:DropDownList><br />
</td><br />
</tr><br />
<tr><br />
<td><br />
Select City:<br />
</td><br />
<td><br />
<asp:DropDownList ID="ddlRegion" runat="server" Height="19px" Width="125px"></asp:DropDownList><br />
</td><br />
</tr><br />
<tr><td></td><td style="font-size:small" align="right">R.Upadhyay</td></tr><br />
</table><br />
</div><br />
</form><br />
</body><br />
</html></blockquote>
<br />
<div>
<br /></div>
<b><u>Code Behind:-</u></b><br />
<b><u><br /></u></b>
<br />
<blockquote>
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Data;<br />
using System.Data.SqlClient;<br />
<br />
public partial class CountryDropdowns : System.Web.UI.Page<br />
{<br />
private String strConnection = "Data Source=IT-HP\\sqlexpress;Initial Catalog=Employee;Integrated Security=True";<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if(!IsPostBack)<br />
{<br />
BindContrydropdown();<br />
}<br />
}<br />
protected void BindContrydropdown()<br />
{<br />
SqlConnection con = new SqlConnection(strConnection);<br />
con.Open();<br />
SqlCommand cmd = new SqlCommand("select * from CountryTable", con);<br />
SqlDataAdapter da = new SqlDataAdapter(cmd);<br />
DataSet ds = new DataSet();<br />
da.Fill(ds);<br />
con.Close();<br />
ddlCountry.DataSource = ds;<br />
ddlCountry.DataTextField = "CountryName";<br />
ddlCountry.DataValueField = "CountryID";<br />
ddlCountry.DataBind();<br />
ddlCountry.Items.Insert(0, new ListItem("--Select--", "0"));<br />
ddlState.Items.Insert(0, new ListItem("--Select--", "0"));<br />
ddlRegion.Items.Insert(0, new ListItem("--Select--", "0"));<br />
}<br />
protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
int CountryID = Convert.ToInt32(ddlCountry.SelectedValue);<br />
SqlConnection con = new SqlConnection(strConnection);<br />
con.Open();<br />
SqlCommand cmd = new SqlCommand("select * from StateTable where CountryID="+CountryID, con);<br />
SqlDataAdapter da = new SqlDataAdapter(cmd);<br />
DataSet ds = new DataSet();<br />
da.Fill(ds);<br />
con.Close();<br />
ddlState.DataSource = ds;<br />
ddlState.DataTextField = "StateName";<br />
ddlState.DataValueField = "StateID";<br />
ddlState.DataBind();<br />
ddlState.Items.Insert(0, new ListItem("--Select--", "0"));<br />
if(ddlState.SelectedValue=="0")<br />
{<br />
ddlRegion.Items.Clear();<br />
ddlRegion.Items.Insert(0, new ListItem("--Select--", "0"));<br />
}<br />
}<br />
protected void ddlState_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
int StateID = Convert.ToInt32(ddlState.SelectedValue);<br />
SqlConnection con = new SqlConnection(strConnection);<br />
con.Open();<br />
SqlCommand cmd = new SqlCommand("select * from CityTable where StateID=" + StateID, con);<br />
SqlDataAdapter da = new SqlDataAdapter(cmd);<br />
DataSet ds = new DataSet();<br />
da.Fill(ds);<br />
con.Close();<br />
ddlRegion.DataSource = ds;<br />
ddlRegion.DataTextField = "CityName";<br />
ddlRegion.DataValueField = "CityID";<br />
ddlRegion.DataBind();<br />
ddlRegion.Items.Insert(0, new ListItem("--Select--", "0"));<br />
}<br />
}</blockquote>
<br />
<div>
<br /></div>
<b><u><br /></u></b></div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-14768790454817161832013-05-28T01:55:00.002-07:002013-05-28T01:55:31.226-07:00Zoom Out & Zoom In Using Jquery in Asp.net<b><u>Demo:-</u></b><br />
<b><u><br /></u></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi119mADFcrFsTtIJoXOw9vduV-Cd1Ra3w0HJF2TDIX94TWWdGGGFuIL7eIqhVAYcGUqB-eb7nJ6yHzJ5Zp_BIn2-L5dTYM5Vu4XZI3YdpLvrfkpzipamuBihbt_IrEXDu8aX1vpFsmmKQ/s1600/ww.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi119mADFcrFsTtIJoXOw9vduV-Cd1Ra3w0HJF2TDIX94TWWdGGGFuIL7eIqhVAYcGUqB-eb7nJ6yHzJ5Zp_BIn2-L5dTYM5Vu4XZI3YdpLvrfkpzipamuBihbt_IrEXDu8aX1vpFsmmKQ/s1600/ww.gif" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
<u style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; line-height: 20px; text-align: left;">Instruction:-</u><span style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: left;"> To Use this code Download jquery-1.9.1.min.js from </span><a href="http://jquery.com/download/" style="background-color: white; color: black; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; outline: none; text-align: left;">http://jquery.com/download/</a><span style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: left;"> and link as shown in code below.</span></div>
<div class="separator" style="clear: both; text-align: justify;">
<span style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: left;"><br /></span></div>
<div class="separator" style="clear: both; text-align: justify;">
<span style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: left;"><b><u>Code:-</u></b></span></div>
<div class="separator" style="clear: both; text-align: justify;">
<span style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: left;"><b><u><br /></u></b></span></div>
<div class="separator" style="clear: both; text-align: justify;">
<span style="background-color: white; font-size: 12px; line-height: 20px; text-align: left;"><span style="color: #333333; font-family: Arial, Helvetica, sans-serif;"></span></span></div>
<blockquote class="tr_bq">
<span style="color: #333333; font-family: Arial, Helvetica, sans-serif;"><html><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><head><div class="separator" style="clear: both; display: inline !important;">
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript" src="jquery-1.9.1.min.js"></script><div class="separator" style="clear: both; display: inline !important;">
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript"><div class="separator" style="clear: both; display: inline !important;">
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>$(document).ready(function()<div class="separator" style="clear: both; display: inline !important;">
<span class="Apple-tab-span" style="white-space: pre;"> </span>{</div>
<span class="Apple-tab-span" style="white-space: pre;"> </span><div class="separator" style="clear: both; display: inline !important;">
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#b4').click(function()</div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d1').animate({width:'+=60px',height:'+=40px'},1000);<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>});<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>$('#b5').click(function()<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d1').animate({width:'-=60px',height:'-=40px'},1000);<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>});<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />function d1_onclick() {<br />}<br /><span class="Apple-tab-span" style="white-space: pre;"> </span></script><span class="Apple-tab-span" style="white-space: pre;"> </span><div class="separator" style="clear: both; display: inline !important;">
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></head><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><body><br /><img id="d1" src="Berlin Falls.jpg" style="width:150;height:100; onclick="return d1_onclick()" /><div class="separator" style="clear: both; display: inline !important;">
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<span class="Apple-tab-span" style="white-space: pre;"> </span><br><br><hr><br><div class="separator" style="clear: both; display: inline !important;">
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<span class="Apple-tab-span" style="white-space: pre;"> </span><br /><div class="separator" style="clear: both; display: inline !important;">
</div>
<span class="Apple-tab-span" style="white-space: pre;"> </span><input id="b5" type="button" value="Zoom Out"/><br /> <input id="b4" type="button" value="Zoom In" /><div class="separator" style="clear: both; display: inline !important;">
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div class="separator" style="clear: both; display: inline !important;">
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></body><br /></html></span></blockquote>
<div class="separator" style="clear: both; text-align: left;">
</div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: left;"><br /></span></div>
<b><u><br /></u></b>My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-63383717535420741552013-05-26T23:03:00.002-07:002013-05-27T20:51:39.852-07:00JQuery Show Hide Option Theme Change & Using Buttons <b><u>Demo:-</u></b><br />
<b><u><br /></u></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8EBABmmxCAng2-tKvT3tG0cen_YTCpYI1atvoEr_b7TRpJQBMIMjLM5b80Y-6Cse5ve4v2o9zpT9U7BjMKS2DnUepjXUnqojwrMXKpDhAyH-f4tt9CGiFY7ouDVFzFpbi4GSi7GvhWv0/s1600/QQ.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8EBABmmxCAng2-tKvT3tG0cen_YTCpYI1atvoEr_b7TRpJQBMIMjLM5b80Y-6Cse5ve4v2o9zpT9U7BjMKS2DnUepjXUnqojwrMXKpDhAyH-f4tt9CGiFY7ouDVFzFpbi4GSi7GvhWv0/s1600/QQ.gif" /></a></div>
<b><u><br /></u></b>
<b><u><br /></u></b>
<u style="font-weight: bold;">Instruction:-</u> To Use this code Download jquery-1.9.1.min.js from <a href="http://jquery.com/download/">http://jquery.com/download/</a> and link as shown in code below.<br />
<b><u><br /></u></b>
<b><u>Code:-</u></b><br />
<b><u><br /></u></b>
<br />
<blockquote>
<html><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><head><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript" src="jquery-1.9.1.min.js"></script><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>$(document).ready(function()<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#b1').click(function()<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d1').css({background:'lightyellow',border:'solid 2px darkgreen',color:'darkgreen',padding:'12px',width:'300px'});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#b2').click(function()<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d1').css({background:'smokewhite',border:'solid 2px darkred',color:'darkred',padding:'12px',width:'300px'});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#b3').click(function()<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d1').css({background:'skyblue',border:'solid 2px darkblue',color:'darkblue',padding:'12px',width:'300px'});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>$('#b11').click(function()<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d2').removeClass();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d2').addClass('green');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>$('#b22').click(function()<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d2').removeClass();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d2').addClass('red');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>$('#b33').click(function()<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d2').removeClass();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d2').addClass('blue');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#btnShow').click(function()<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d1').show('fadeIn');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>$('#btnHide').click(function()<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d1').hide('fadeOut');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>$('#btnToggle').click(function()<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#d2').toggle('slow');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></script><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><style type="text/css"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>.green{background:lightyellow;border:solid 2px darkgreen;color:darkgreen;padding:12px;width:300px}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>.red{background:pink;border:solid 2px darkred;color:darkred;padding:12px;width:300px}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>.blue{background:skyblue;border:solid 2px darkblue;color:darkblue;padding:12px;width:300px}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></style><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></head><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><body><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><div id="d1" style="width:150;height:100;"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><a href="http://aspdotnetstudio.blogspot.in/"><h2>Aspdotnet Studio<h2></a><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></div><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br><br><hr><br><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><input id="b1" type="button" value="Green Theme"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><input id="b2" type="button" value="Red Theme"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><input id="b3" type="button" value="Blue Theme"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><input id="btnHide" type="button" value="hide"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><input id="btnShow" type="button" value="show"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span></body><br />
</html></blockquote>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-21600624006894497742013-05-22T23:54:00.001-07:002013-05-22T23:54:34.161-07:00Disable Autofilling in all browser on Web Page Text Box<b><u>Demo:-</u></b><br />
<b><u><br /></u></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqN6Db0gTX-TGCiFDAyf_Rh4zs_xHYFwahKb4-fhpedOM2OX6VY9TH5bMbfOJX9_ikfHCbz85UDox_ON15tVdazmLNhtS25phXXpYvwleYXv4fnGoFGmzTlUpWhb-ALSqiAR3bB55iN2g/s1600/aaaaaa.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqN6Db0gTX-TGCiFDAyf_Rh4zs_xHYFwahKb4-fhpedOM2OX6VY9TH5bMbfOJX9_ikfHCbz85UDox_ON15tVdazmLNhtS25phXXpYvwleYXv4fnGoFGmzTlUpWhb-ALSqiAR3bB55iN2g/s1600/aaaaaa.gif" /></a></div>
<b><u><br /></u></b>
<u style="font-weight: bold;">Instruction:-</u> In This we use Autocomplete Property.<br />
<br />
<blockquote class="tr_bq">
autocomplete="off" </blockquote>
<br />
<b><u>Design Code:-</u></b><br />
<b><u><br /></u></b>
<br />
<blockquote>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head id="Head1" runat="server"><br /><title>Disable Autofilling in all browser on Web Page Text Box</title><br /><style type="text/css"><br />.Button<br />{<br />background-color :#0066CC;<br />color: #FFFFFF;<br />font-weight: bold;<br />margin-right: 2px;<br />padding: 4px 20px 4px 21px;<br />}<br /></style><br /></head><br /><body><br /><form id="form1" runat="server" autocomplete="off"><br /><fieldset style="height: 242px; width: 470px"><br /><legend>Contact Us</legend><br /><table cellspacing="2" cellpadding="2" border="0"><br /><br /><br /><tr><td>Name:-</td><td><asp:TextBox ID="txtName" runat="server" /></td></tr><br /><br /><br /><tr><td>Email:-</td><td><asp:TextBox ID="txtEmail" runat="server" /></td></tr><br /><br /><tr><td>Subject:-</td><td><asp:TextBox ID="txtSubject" runat="server" /></td></tr><br /><br /><tr><td valign="top">Query:-</td><br /><br /><td> <asp:TextBox ID="txtMessage" Rows="5" Columns="40" TextMode="MultiLine" runat="server"/></td></tr><br /><tr><br /><td><asp:button ID="btnSubmitt" Text="Submit" runat="server" onclick="btn_Click" CssClass="Button"/></td></tr><br /><tr><td colspan="2" style=" color:red"><asp:Label ID="lbltxt" runat="server"/></td></tr><br /></table><br /></fieldset><br /></form><br /></body><br /></html></blockquote>
<div style="text-decoration: underline;">
<br /></div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-89457647484378290592013-05-21T04:34:00.003-07:002013-05-21T04:34:56.981-07:00Right Click Disable On Picture and Page In Asp.net<b><u>Demo:-</u></b><br />
<b><u><br /></u></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmRd_BWNnzr6ShviEL4vDnyDK4coykmnmiQKGVdWtuJZGSJvQ4G0yw0xsBTn29Vldp0Sf_Ghq14GLY5eoe9FTg5VWwXuwHOs6c-YjdSIqUZYnsnLU8qLsMWemuj2Yjq2frfUexpfYmVdY/s1600/wwq.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmRd_BWNnzr6ShviEL4vDnyDK4coykmnmiQKGVdWtuJZGSJvQ4G0yw0xsBTn29Vldp0Sf_Ghq14GLY5eoe9FTg5VWwXuwHOs6c-YjdSIqUZYnsnLU8qLsMWemuj2Yjq2frfUexpfYmVdY/s1600/wwq.gif" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u>Code:-</u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><br /></u></b></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<blockquote class="tr_bq">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head runat="server"><br /> <title>Restrict Right Click</title><br /> <br /> <script type="text/javascript"><br />function disableRightClick()<br />{<br />alert("Right Click not Allowed !!");<br />return false;<br />}<br /></script><br /> <br /></head><br /><body oncontextmenu=" return disableRightClick();"><br /> <form id="form1" runat="server"><br /> <div><br /> <asp:Image ID="img1" runat="server" ImageUrl="~/1.jpeg" Width="261px"<br /> oncontextmenu="return false;" Height="214px" /><br /> <br /> </div><br /> </form><br /></body><br /></html></blockquote>
<div style="font-weight: bold; text-decoration: underline;">
<br /></div>
<br />
<b><u><br /></u></b>My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-14588918420277410462013-05-20T02:26:00.004-07:002013-05-20T02:33:13.170-07:00Set Default Focus on Page Or Text Box Using Default Focus Property Asp.net<u style="font-weight: bold;">Instruction:-</u> In this we use this property<br />
<br />
<blockquote class="tr_bq">
<form id="form1" runat="server" defaultfocus="TxtUserId"></blockquote>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u>Demo:-</u></b><br />
<b><u><br /></u></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVAebXsE2P7gIhe1IRGldfdM2OrTtawGK8bfATOy26lwH-OxBY5ObpxWbWKkJrpL3NGCJe-vG_lOJGljJ3K4F8elB5x77VF2S9t5D8oiTQW3DWZ0n6hVrRhIHIqCA2jT7kzFmwGxWvVbI/s1600/111111111111.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVAebXsE2P7gIhe1IRGldfdM2OrTtawGK8bfATOy26lwH-OxBY5ObpxWbWKkJrpL3NGCJe-vG_lOJGljJ3K4F8elB5x77VF2S9t5D8oiTQW3DWZ0n6hVrRhIHIqCA2jT7kzFmwGxWvVbI/s1600/111111111111.gif" /></a></div>
<b><u>Code:-</u></b><br />
<b><u><br /></u></b>
<br />
<blockquote>
<%@ Page Language="C#" %><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<script runat="server"><br />
</script><br />
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<head id="Head1" runat="server"><br />
<title>Set Default Focus On a Page Or Text Boxes</title><br />
</head><br />
<body><br />
<form id="form1" runat="server" defaultfocus="TxtUserId"><br />
<div><br />
<h2 style="color:red">Default Focus </h2><br />
<br />
<table><tr><td><br />
<asp:Label ID="Label1" runat="server" Font-Bold="true" ForeColor="Orange" Text="User Name" ><br />
</asp:Label><br />
</td><br />
<td><br />
<asp:TextBox ID="TxtUserName" runat="server" BackColor="Orange" ><br />
</asp:TextBox><br />
</td><br />
</tr><br />
<tr><td><br />
<asp:Label ID="Label2" runat="server" Font-Bold="true" ForeColor="Orange" Text="User Id" ><br />
</asp:Label><br />
</td><br />
<td><br />
<asp:TextBox ID="TxtUserId" runat="server" BackColor="Orange" > </asp:TextBox><br />
</td><br />
<tr><td colspan=2><center><asp:Button ID="Button1" runat="server" Font-Bold="true" ForeColor="Black" Text="Submit" /></center></td></tr><br />
<br />
</tr><br />
</table><br />
</div><br />
</form><br />
</body><br />
</html></blockquote>
<div style="font-weight: bold; text-decoration: underline;">
<br /></div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-14383419210357037122013-05-19T23:18:00.002-07:002013-05-20T00:36:57.583-07:00Alert Message Box Using Javascript Codebehind Asp.net.<b><u>Demo:-</u></b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhON-30D-SPztVDIz-lWhWLgoY9UEwhNq2CxU5mpepK_6aFN0q6KnQBD4oI813JuTHULr0on3K77BKr4wuTk1Z94Rp44GDzd0c-cFwlaPDz-q_QYzoo5cxqbgr0HR5HzgLJ0Mr6B_OQjM8/s1600/8787878.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhON-30D-SPztVDIz-lWhWLgoY9UEwhNq2CxU5mpepK_6aFN0q6KnQBD4oI813JuTHULr0on3K77BKr4wuTk1Z94Rp44GDzd0c-cFwlaPDz-q_QYzoo5cxqbgr0HR5HzgLJ0Mr6B_OQjM8/s1600/8787878.gif" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u>Design Code:-</u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><br /></u></b></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<blockquote class="tr_bq">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableEventValidation="false" %><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<head id="Head1" runat="server"><br />
<title>Aspdotnet Studio</title><br />
<script type="text/javascript"><br />
function Showalert() {<br />
alert('Alert from codebehind');<br />
}<br />
</script><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<asp:Button ID="btnS" runat="server" Text="Show alert" onclick="btnS_Click" /><br />
<asp:Button ID="btnC" runat="server" Text="Call JavaScript Function"<br />
onclick="btnC_Click" /><br />
</div><br />
</form><br />
</body><br />
</html></blockquote>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<b><u>Code Behind:-</u></b></div>
<div class="separator" style="clear: both;">
<b><u><br /></u></b></div>
<div class="separator" style="clear: both;">
</div>
<blockquote>
using System;<br />
using System.Configuration;<br />
using System.Data;<br />
using System.Data.SqlClient;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.HtmlControls;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Xml.Linq;<br />
public partial class _Default : System.Web.UI.Page<br />
{<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
}<br />
protected void btnS_Click(object sender, EventArgs e)<br />
{<br />
ScriptManager.RegisterStartupScript(this,GetType(),"showalert","alert('This is Simple Alert Message');",true);<br />
}<br />
protected void btnC_Click(object sender, EventArgs e)<br />
{<br />
ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert();", true);<br />
}<br />
}</blockquote>
<div style="text-decoration: underline;">
<br /></div>
<br />My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-80522715588774304152013-05-17T04:24:00.004-07:002013-05-17T04:24:36.087-07:00Check User Name is Available Or Not Using Asp.net<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: justify;">
<b style="text-align: left;"><u>Demo:-</u></b></div>
<div>
<b style="text-align: left;"><u><br /></u></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyU9sB8acSPCT98jtgvY5HnWZjEGbXMb3ZMnDdF8Qn2LMWTvCKhq6VrYU1DARPopkKLYu4SzwlLCQsROeF2ZKUiw02j0c6WlhodWK4vCtdd2vEnLWwIEyp0uG-kd3zizbOkCOhNiPW4rk/s1600/uuuuuuu.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyU9sB8acSPCT98jtgvY5HnWZjEGbXMb3ZMnDdF8Qn2LMWTvCKhq6VrYU1DARPopkKLYu4SzwlLCQsROeF2ZKUiw02j0c6WlhodWK4vCtdd2vEnLWwIEyp0uG-kd3zizbOkCOhNiPW4rk/s1600/uuuuuuu.gif" /></a></div>
<br />
<b><u>Design Code:-</u></b><br />
<b><u><br /></u></b>
<br />
<blockquote class="tr_bq">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableEventValidation="false" %><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head runat="server"><br /> <title>Check Username availability Using Ajax</title><br /> <style type="text/css"><br /> .waitingdiv {<br /> background-color: #F5F8FA;<br /> border: 1px solid #5A768E;<br /> color: #333333;<br /> font-size: 93%;<br /> margin-bottom: 1em;<br /> margin-top: 0.2em;<br /> padding: 8px 12px;<br /> width: 8.4em;<br />}<br /></style><br /> <br /></head><br /><body><br /> <form id="form1" runat="server"><br /> <asp:ScriptManager ID="scriptmanager1" runat="server"><br /> </asp:ScriptManager><br /> <script type="text/javascript"><br />Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);<br />function BeginRequestHandler(sender, args) {<br />var state = document.getElementById('loadingdiv').style.display;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>if (state == 'block') {<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>document.getElementById('loadingdiv').style.display = 'none';<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>} else {<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>document.getElementById('loadingdiv').style.display = 'block';<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />args.get_postBackElement().disabled = true;<br />}<br /></script><br /> <div><br /> <br /> <asp:UpdatePanel ID="PnlUsrDetails" runat="server"><br /> <ContentTemplate><br /> <table><br /> <tr><br /> <td><br /> UserName:<br /> </td><br /> <td><br /> <asp:TextBox ID="txtUsername" runat="server" AutoPostBack="true" ontextchanged="txtUsername_TextChanged"/><br /> </td><br /> <td><br /> <div id="checkusername" runat="server" Visible="false"><br /> <asp:Image ID="imgstatus" runat="server" Width="17px" Height="17px"/><br /> <asp:Label ID="lblStatus" runat="server"></asp:Label><br /> </div><br /> </td><br /> </tr><br /> </table><br /> <div class="waitingdiv" id="loadingdiv" style="display:none; margin-left:5.3em"><br /> <img src="LoadingImage.gif" alt="Loading" />Wait a movment...<br /> </div><br /> </ContentTemplate><br /> </asp:UpdatePanel><br /> </div><br /> </form><br /></body><br /></html></blockquote>
<b><u><br /></u></b>
<b><u>Code Behind:-</u></b><br />
<b><u><br /></u></b>
<br />
<blockquote class="tr_bq">
using System;<br />using System.Configuration;<br />using System.Data;<br />using System.Data.SqlClient;<br />using System.Linq;<br />using System.Web;<br />using System.Web.Security;<br />using System.Web.UI;<br />using System.Web.UI.HtmlControls;<br />using System.Web.UI.WebControls;<br />using System.Web.UI.WebControls.WebParts;<br />using System.Xml.Linq;<br />public partial class _Default : System.Web.UI.Page<br />{<br /> protected void Page_Load(object sender, EventArgs e)<br /> { <br /> }<br />protected void txtUsername_TextChanged(object sender, EventArgs e)<br />{<br />if(!string.IsNullOrEmpty(txtUsername.Text))<br />{<br />SqlConnection con = new SqlConnection("Data Source=IT-HP\\sqlexpress;Initial Catalog=Employee;Integrated Security=True");<br />con.Open();<br />SqlCommand cmd = new SqlCommand("select * from UserInformation where UserName=@Name", con);<br />cmd.Parameters.AddWithValue("@Name", txtUsername.Text);<br />SqlDataReader dr = cmd.ExecuteReader();<br />if (dr.HasRows)<br />{<br />checkusername.Visible = true;<br />imgstatus.ImageUrl = "NotAvailable.jpg";<br />lblStatus.Text = "Username is not Available";<br />System.Threading.Thread.Sleep(2000);<br />}<br />else<br />{<br />checkusername.Visible = true;<br />imgstatus.ImageUrl = "Icon_Available.gif";<br />lblStatus.Text = "UserName Available";<br />System.Threading.Thread.Sleep(2000);<br />}}<br />else<br />{<br />checkusername.Visible = false;<br />}}}</blockquote>
<div style="font-weight: bold; text-decoration: underline;">
<br /></div>
<br />
<div style="font-weight: bold; text-decoration: underline;">
<br /></div>
</div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-14265509923837718612013-05-17T03:34:00.001-07:002013-05-17T03:34:58.031-07:00Create Row & Column in Table Using Button in Asp.net<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: left;">
<b><u>Demo-:</u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><br /></u></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggpWjK76axdTJdJFuQK70zu-kWhKDT-e4OQtn9funI91yWBDcsEJZr3GiigeqR106y5sja1LdQ8ZP0gzL2UDXg3QI12s63X3XYd-U9IhLL5FiIuYLDyT9sC-y7RA6-Zpv92BDwOBRxYZ4/s1600/ggggggg.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggpWjK76axdTJdJFuQK70zu-kWhKDT-e4OQtn9funI91yWBDcsEJZr3GiigeqR106y5sja1LdQ8ZP0gzL2UDXg3QI12s63X3XYd-U9IhLL5FiIuYLDyT9sC-y7RA6-Zpv92BDwOBRxYZ4/s1600/ggggggg.gif" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u>Code-:</u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u><br /></u></b></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<blockquote>
<%@ Page Language="C#" %><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<script runat="server"><br />
protected void Button1_Click(object sender, System.EventArgs e) {<br />
int rows = Int32.Parse(TextBox1.Text);<br />
int columns = Int32.Parse(TextBox2.Text);<br />
for (int row = 0; row < rows; row++ )<br />
{<br />
TableRow newRow = new TableRow();<br />
Table1.Controls.Add(newRow);<br />
for (int column = 0; column < columns; column++ )<br />
{<br />
TableCell newCell = new TableCell();<br />
newCell.Text = "Cell" + row.ToString();<br />
newCell.Text += "; Column" + column.ToString();<br />
newCell.BorderStyle = BorderStyle.Solid;<br />
newCell.BorderWidth = Unit.Pixel(1);<br />
newCell.BorderColor = System.Drawing.Color.DodgerBlue;<br />
newRow.Controls.Add(newCell);<br />
}<br />
}<br />
}<br />
</script><br />
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<head id="Head1" runat="server"><br />
<title>Create Row & Column in Table Using Button in Asp.net </title><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<table><br />
<tr><td colspan=2><h2 style="color:red">Row & Column in Table</h2></td></tr><br />
<tr><br />
<td><br />
<asp:Label ID="Label1" runat="server" Font-Bold="true" ForeColor="#FF9900" Text="Rows"><br />
</asp:Label></td><br />
<td><asp:TextBox ID="TextBox1" runat="server" BackColor="skyblue" ForeColor="FloralWhite"><br />
</asp:TextBox></td><br />
<br />
</tr><br />
<br /><tr><td> <asp:Label ID="Label2" runat="server" Font-Bold="true" ForeColor="#FF9900" Text="Columns"><br />
</asp:Label></td><br />
<td><asp:TextBox ID="TextBox2" runat="server" BackColor="skyblue" ForeColor="FloralWhite"><br />
</asp:TextBox><br />
</td><br />
</tr><br />
<br /><br /><br />
<tr><td colspan=2> <asp:Button ID="Button1" runat="server" Font-Bold="true" ForeColor="red" OnClick="Button1_Click" Text="Create Table"/></td></tr><br />
<br />
<br /><br /><br />
</table><br />
<asp:Table ID="Table1" runat="server" BorderWidth="1" BorderColor="DodgerBlue"><br />
</asp:Table><br />
<br />
<br />
</div><br />
</form><br />
</body><br />
</html></blockquote>
<div style="font-weight: bold; text-decoration: underline;">
<br /></div>
<br />
<br /></div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-47039803119007348622013-05-15T22:27:00.003-07:002013-05-15T22:59:28.228-07:00How to Send Gridview in Email in Asp.Net Using C#, VB.NET<div dir="ltr" style="text-align: left;" trbidi="on">
<b><u>Demo-:</u></b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSPwRWxWZvAEWbGKrI6gzk0d7y1u4fuSd-OwQPjuJpEpbid0hJHp1sVzOwZQ1Jcm_LJeD3bfq21jY1FZq1FY-k6sF4rDfW7u0qqsV2sZoM7HatdHRX3hunLf7pikGlPXNmuXb4NJoIJd8/s1600/SendGridviewAsMail.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="288" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSPwRWxWZvAEWbGKrI6gzk0d7y1u4fuSd-OwQPjuJpEpbid0hJHp1sVzOwZQ1Jcm_LJeD3bfq21jY1FZq1FY-k6sF4rDfW7u0qqsV2sZoM7HatdHRX3hunLf7pikGlPXNmuXb4NJoIJd8/s400/SendGridviewAsMail.png" width="400" /></a></div>
<b><u><br /></u></b>
<b><u>Design Code-:</u></b><br />
<b><u><br /></u></b>
<br />
<br />
<blockquote class="tr_bq">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SendGridEmail.aspx.cs" Inherits="SendGridviewWithEmail" %><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<head id="Head1"><br />
<title>Send Mail Gridview Asp.net </title><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<asp:GridView ID="gvUserInfo" runat="server"><br />
<HeaderStyle BackColor="#6699FF" Font-Bold="true" ForeColor="White" /><br />
</asp:GridView><br />
</div><br /><br /><br />
<asp:Button ID="btnSendMail" runat="server" Text="Send Gridview As Mail" onclick="btnSendMail_Click" /><br />
</form><br />
</body><br />
</html></blockquote>
<br />
<br />
<b><u>Asp.net Code Behind-:</u></b><br />
<b><u><br /></u></b>
<br />
<blockquote class="tr_bq">
using System;<br />
using System.Web;<br />
using System.Data.SqlClient;<br />
using System.Data;<br />
using System.Net.Mail;<br />
using System.Text;<br />
using System.IO;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
public partial class SendGridEmail: System.Web.UI.Page<br />
{<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (!IsPostBack)<br />
{<br />
BindGridview();<br />
}<br />
}<br />
// Bind Databse with Gridview<br />
protected void BindGridview()<br />
{<br />
SqlConnection con = new SqlConnection("Data Source=IT-HP\\sqlexpress;Initial Catalog=Employee;Integrated Security=True");<br />
con.Open();<br />
SqlCommand cmd = new SqlCommand("SELECT TOP 10 UserName,FirstName,LastName,Location FROM UserInformation", con);<br />
SqlDataAdapter da = new SqlDataAdapter(cmd);<br />
DataSet ds = new DataSet();<br />
da.Fill(ds);<br />
gvUserInfo.DataSource = ds;<br />
gvUserInfo.DataBind();<br />
}<br />
protected void btnSendMail_Click(object sender, EventArgs e)<br />
{<br />
SendHTMLMail();<br />
}<br />
// Get HTML File and replace HTML File values with values and send mail<br />
public void SendHTMLMail()<br />
{<br />
MailMessage Msg = new MailMessage();<br />
MailAddress fromMail = new MailAddress("rahulupadhyay010@gmail.com");<br />
// Sender e-mail address.<br />
Msg.From = fromMail;<br />
// Recipient e-mail address.<br />
Msg.To.Add(new MailAddress("Aspdotnetstudio@gmail.com"));<br />
// Subject of e-mail<br />
Msg.Subject = "Send Gridivew in EMail";<br />
Msg.Body += "Please check below data <br/><br/>";<br />
Msg.Body += GetGridviewData(gvUserInfo);<br />
Msg.IsBodyHtml = true;<br />
string sSmtpServer = "";<br />
sSmtpServer = "smtp.gmail.com";<br />
SmtpClient a = new SmtpClient();<br />
a.Host = sSmtpServer;<br />
a.EnableSsl = true;<br />
a.Send(Msg);<br />
}<br />
// This Method is used to render gridview control<br />
public string GetGridviewData(GridView gv)<br />
{<br />
StringBuilder strBuilder = new StringBuilder();<br />
StringWriter strWriter = new StringWriter(strBuilder);<br />
HtmlTextWriter htw = new HtmlTextWriter(strWriter);<br />
gv.RenderControl(htw);<br />
return strBuilder.ToString();<br />
}<br />
public override void VerifyRenderingInServerForm(Control control)<br />
{<br />
/* Verifies that the control is rendered */<br />
}<br />
}</blockquote>
<br />
<b><u><br /></u></b>
<b><u>VB.net Code-:</u></b><br />
<b><u><br /></u></b>
<br />
<blockquote>
Imports System.Web<br />
Imports System.Data.SqlClient<br />
Imports System.Data<br />
Imports System.Net.Mail<br />
Imports System.Text<br />
Imports System.IO<br />
Imports System.Web.UI<br />
Imports System.Web.UI.WebControls<br />
Partial Class VBSendGridviewMail<br />
Inherits System.Web.UI.Page<br />
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load<br />
If Not IsPostBack Then<br />
BindGridview()<br />
End If<br />
End Sub<br />
' This method is used to bind gridview from database<br />
Protected Sub BindGridview()<br />
Dim con As New SqlConnection("Data Source=IT-HP\\sqlexpress;Initial Catalog=Employee;Integrated Security=True")<br />
con.Open()<br />
Dim cmd As New SqlCommand("SELECT TOP 10 UserName,FirstName,LastName,Location FROM UserInformation", con)<br />
Dim da As New SqlDataAdapter(cmd)<br />
Dim ds As New DataSet()<br />
da.Fill(ds)<br />
gvUserInfo.DataSource = ds<br />
gvUserInfo.DataBind()<br />
End Sub<br />
Protected Sub btnSendMail_Click(ByVal sender As Object, ByVal e As EventArgs)<br />
SendHTMLMail()<br />
End Sub<br />
' Method Which is used to Get HTML File and replace HTML File values with dynamic values and send mail<br />
Public Sub SendHTMLMail()<br />
Dim Msg As New MailMessage()<br />
Dim fromMail As New MailAddress("rahulupadhyay010@gmail.com")<br />
' Sender e-mail address.<br />
Msg.From = fromMail<br />
' Recipient e-mail address.<br />
Msg.[To].Add(New MailAddress("Aspdotnetstudio@gmail.com"))<br />
' Subject of e-mail<br />
Msg.Subject = "Send Gridivew in EMail"<br />
Msg.Body += "Please check below data <br/><br/>"<br />
Msg.Body += GetGridviewData(gvUserInfo)<br />
Msg.IsBodyHtml = True<br />
Dim sSmtpServer As String = ""<br />
sSmtpServer = "smtp.gmail.com"<br />
Dim a As New SmtpClient()<br />
a.Host = sSmtpServer<br />
a.EnableSsl = True<br />
a.Send(Msg)<br />
End Sub<br />
' This Method is used to render gridview control<br />
Public Function GetGridviewData(ByVal gv As GridView) As String<br />
Dim strBuilder As New StringBuilder()<br />
Dim strWriter As New StringWriter(strBuilder)<br />
Dim htw As New HtmlTextWriter(strWriter)<br />
gv.RenderControl(htw)<br />
Return strBuilder.ToString()<br />
End Function<br />
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)<br />
' Verifies that the control is rendered<br />
End Sub<br />
End Class</blockquote>
<div style="font-weight: bold; text-decoration: underline;">
<br /></div>
<br />
<b><u><br /></u></b>
</div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-47391147905244743412013-05-14T23:44:00.001-07:002013-05-14T23:47:05.880-07:00Upload and Download Files From Database in Asp.Net<div dir="ltr" style="text-align: left;" trbidi="on">
<b><u>Demo:-</u></b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8keUtdHZ0gmAMHu9pq9QW04i8Vpqd8zK75bejG_3Jx3MO8EGYVyQMxu5E2DWSjVq-wyonnTkh0BwA3SWSQQZr76Jnc2UCr33q-L4Gy4RHpkw4He4xghVpSn_TVAk6NvjZbDKN-wAztPs/s1600/zzzzzzzz.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8keUtdHZ0gmAMHu9pq9QW04i8Vpqd8zK75bejG_3Jx3MO8EGYVyQMxu5E2DWSjVq-wyonnTkh0BwA3SWSQQZr76Jnc2UCr33q-L4Gy4RHpkw4He4xghVpSn_TVAk6NvjZbDKN-wAztPs/s400/zzzzzzzz.gif" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<b>Click On Image To Enlarge</b></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<u style="font-weight: bold;">Instruction:-</u> To use this code first you create a table in Sql Server named as file_table.And make these fields in Table Given Below in Picture.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipKn6hvN6jIp_SRGOwMOM0mHRHYBgBOn325oGG8mGyLzEerqaSMGMYUpJQoTlDAkSU1npKwNnVHcCxSGPTXeiAK5PXTQIQZ_sHy-LQ8YkOUv4T22IEXtOhjsXXtVoIRJGD4c99fTBV-Sw/s1600/Untitledaa.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipKn6hvN6jIp_SRGOwMOM0mHRHYBgBOn325oGG8mGyLzEerqaSMGMYUpJQoTlDAkSU1npKwNnVHcCxSGPTXeiAK5PXTQIQZ_sHy-LQ8YkOUv4T22IEXtOhjsXXtVoIRJGD4c99fTBV-Sw/s1600/Untitledaa.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<b><u>Design Code:-</u></b></div>
<div class="separator" style="clear: both; text-align: justify;">
<b><u><br /></u></b></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<blockquote class="tr_bq">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<head id="Head1"><br />
<title>Upload Word Document Files<br />
</title><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<asp:FileUpload ID="fileUpload1" runat="server" /><br /><br />
<asp:Button ID="btnUpload" runat="server" Text="Upload" onclick="btn_Upload" /><br />
</div><br />
<div><br />
<asp:GridView ID="gvDetails" runat="server" AutoGenerateColumns="false" DataKeyNames="Id"><br />
<HeaderStyle BackColor="blue" Font-Bold="true" ForeColor="White" /><br />
<Columns><br />
<asp:BoundField DataField="Id" HeaderText="Id" /><br />
<asp:BoundField DataField="FileName" HeaderText="FileName" /><br />
<asp:TemplateField HeaderText="FilePath"><br />
<ItemTemplate><br />
<asp:LinkButton ID="lnkDownload" runat="server" Text="Download" OnClick="Download_Click"></asp:LinkButton><br />
</ItemTemplate><br />
</asp:TemplateField><br />
</Columns><br />
</asp:GridView><br />
</div><br />
</form><br />
</body><br />
</html></blockquote>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<b><u>Code Behind:-</u></b></div>
<div class="separator" style="clear: both;">
<b><u><br /></u></b></div>
<div class="separator" style="clear: both;">
</div>
<blockquote class="tr_bq">
using System;<br />
using System.Data.SqlClient;<br />
using System.IO;<br />
using System.Web.UI.WebControls;<br />
public partial class _Default : System.Web.UI.Page<br />
{<br />
string strCon = "Data Source=IT-HP\\sqlexpress;Initial Catalog=Employee;Integrated Security=True";<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (!IsPostBack)<br />
{<br />
BindGridviewData();<br />
}<br />
}<br />
// Bind Gridview Data<br />
private void BindGridviewData()<br />
{<br />
using (SqlConnection con=new SqlConnection(strCon))<br />
{<br />
using (SqlCommand cmd=new SqlCommand())<br />
{<br />
cmd.CommandText = "select * from File_Table";<br />
cmd.Connection = con;<br />
con.Open();<br />
gvDetails.DataSource = cmd.ExecuteReader();<br />
gvDetails.DataBind();<br />
con.Close();<br />
}<br />
}<br />
}<br />
// Save files to Folder and files path in database<br />
protected void btn_Upload(object sender, EventArgs e)<br />
{<br />
string filename = Path.GetFileName(fileUpload1.PostedFile.FileName);<br />
Stream str = fileUpload1.PostedFile.InputStream;<br />
BinaryReader br = new BinaryReader(str);<br />
Byte[] size = br.ReadBytes((int) str.Length);<br />
using (SqlConnection con=new SqlConnection(strCon))<br />
{<br />
using (SqlCommand cmd=new SqlCommand())<br />
{<br />
cmd.CommandText = "insert into File_Table(FileName,FileType,FileData) values(@Name,@Type,@Data)";<br />
cmd.Parameters.AddWithValue("@Name", filename);<br />
cmd.Parameters.AddWithValue("@Type", "application/word");<br />
cmd.Parameters.AddWithValue("@Data", size);<br />
cmd.Connection =con;<br />
con.Open();<br />
cmd.ExecuteNonQuery();<br />
con.Close();<br />
BindGridviewData(); <br />
}<br />
}<br />
}<br />
// This button click event is used to download files from gridview<br />
protected void Download_Click(object sender, EventArgs e)<br />
{<br />
LinkButton lnkbtn = sender as LinkButton;<br />
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;<br />
int fileid = Convert.ToInt32(gvDetails.DataKeys[gvrow.RowIndex].Value.ToString());<br />
string name, type;<br />
using (SqlConnection con=new SqlConnection(strCon))<br />
{<br />
using (SqlCommand cmd=new SqlCommand())<br />
{<br />
cmd.CommandText = "select FileName, FileType, FileData from File_Table where Id=@Id";<br />
cmd.Parameters.AddWithValue("@id", fileid);<br />
cmd.Connection = con;<br />
con.Open();<br />
SqlDataReader dr = cmd.ExecuteReader();<br />
if(dr.Read())<br />
{<br />
Response.ContentType = dr["FileType"].ToString();<br />
Response.AddHeader("Content-Disposition", "attachment;filename=\"" +dr["FileName"] + "\"");<br />
Response.BinaryWrite((byte[])dr["FileData"]);<br />
Response.End();<br />
}<br />
}<br />
}<br />
}<br />
}</blockquote>
<div style="font-weight: bold; text-decoration: underline;">
<br /></div>
<br />
<div class="separator" style="clear: both; font-weight: bold; text-decoration: underline;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<b><u><br /></u></b></div>
</div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-59367674381383129282013-05-13T00:14:00.001-07:002013-05-13T00:51:58.363-07:00Insert,Edit,Delete,Update in Grid View Using Asp.net<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="tr_bq">
<u style="font-weight: bold;">Demo-:</u> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheEIyUmCcPkUl04QB4Ew8AVHEIcQg7hAF9Dny1cmWxA3-o0xVgs2aVWjcGmHZ4vKM1S96u-k5YLJOB8FIRHJLeunuSZf8L_lhKub-OMThEefjvvQf2MaRYBOwYrydcdcrcle__0gf7qZM/s1600/ra2222.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheEIyUmCcPkUl04QB4Ew8AVHEIcQg7hAF9Dny1cmWxA3-o0xVgs2aVWjcGmHZ4vKM1S96u-k5YLJOB8FIRHJLeunuSZf8L_lhKub-OMThEefjvvQf2MaRYBOwYrydcdcrcle__0gf7qZM/s400/ra2222.gif" width="400" /></a></div>
<u style="font-weight: bold;"><br /></u>
<u style="font-weight: bold;"><br /></u>
<u style="font-weight: bold;">Instructions-:</u> To use this Code First of all create a table in database named as Employee and create fields in that table<br />
<span style="color: #222222; font-family: Verdana, sans-serif; font-size: x-small;">1. UserId ,Int,Set Identity property True</span><br />
<span style="color: #222222; font-family: Verdana, sans-serif; font-size: x-small;">2. UserName ,Varchar(50)</span><br />
<span style="color: #222222; font-family: Verdana, sans-serif; font-size: x-small;">3. City,</span><span style="color: #222222; font-family: Verdana, sans-serif; font-size: x-small;">Varchar(50)</span><br />
<span style="color: #222222; font-family: Verdana, sans-serif; font-size: x-small;">4. Designation,</span><span style="color: #222222; font-family: Verdana, sans-serif; font-size: x-small;">Varchar(50)</span><br />
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u>Design Code-:</u></b><br />
<b><u><br /></u></b>
<br />
<blockquote class="tr_bq">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml" ><br />
<head id="Head1" runat="server"><br />
<title>Untitled Page</title><br />
<style type="text/css"><br />
.Gridview<br />
{<br />
font-family:Verdana;<br />
font-size:10pt;<br />
font-weight:normal;<br />
color:black;<br />
}<br />
</style><br />
<script type="text/javascript"><br />
function ConfirmationBox(username) {<br />
var result = confirm('Are you sure you want to delete '+username+' Details?' );<br />
if (result) {<br />
return true;<br />
}<br />
else {<br />
return false;<br />
}}<br />
</script><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<asp:GridView ID="gvDetails" DataKeyNames="UserId,UserName" runat="server"<br />
AutoGenerateColumns="false" CssClass="Gridview" HeaderStyle-BackColor="#61A6F8"<br />
ShowFooter="true" HeaderStyle-Font-Bold="true" HeaderStyle-ForeColor="White"<br />
onrowcancelingedit="gvDetails_RowCancelingEdit"<br />
onrowdeleting="gvDetails_RowDeleting" onrowediting="gvDetails_RowEditing"<br />
onrowupdating="gvDetails_RowUpdating"<br />
onrowcommand="gvDetails_RowCommand"><br />
<br />
<Columns><br />
<asp:TemplateField><br />
<EditItemTemplate><br />
<asp:ImageButton ID="imgbtnUpdate" CommandName="Update" runat="server" ImageUrl="~/Images/update.jpg" ToolTip="Update" Height="20px" Width="20px" /><br />
<asp:ImageButton ID="imgbtnCancel" runat="server" CommandName="Cancel" ImageUrl="~/Images/Cancel.png" ToolTip="Cancel" Height="20px" Width="20px" /><br />
</EditItemTemplate><br />
<ItemTemplate><br />
<asp:ImageButton ID="imgbtnEdit" CommandName="Edit" runat="server" ImageUrl="~/Images/Edit.png" ToolTip="Edit" Height="20px" Width="20px" /><br />
<asp:ImageButton ID="imgbtnDelete" CommandName="Delete" Text="Edit" runat="server" ImageUrl="~/Images/delete.png" ToolTip="Delete" Height="20px" Width="20px" /><br />
</ItemTemplate><br />
<FooterTemplate><br />
<asp:ImageButton ID="imgbtnAdd" runat="server" ImageUrl="~/Images/AddNewitem.png" CommandName="AddNew" Width="30px" Height="30px" ToolTip="Add new User" ValidationGroup="validaiton" /><br />
</FooterTemplate><br />
</asp:TemplateField><br />
<asp:TemplateField HeaderText="UserName"><br />
<EditItemTemplate><br />
<asp:Label ID="lbleditusr" runat="server" Text='<%#Eval("Username") %>'/><br />
</EditItemTemplate><br />
<ItemTemplate><br />
<asp:Label ID="lblitemUsr" runat="server" Text='<%#Eval("UserName") %>'/><br />
</ItemTemplate><br />
<FooterTemplate><br />
<asp:TextBox ID="txtftrusrname" runat="server"/><br />
<asp:RequiredFieldValidator ID="rfvusername" runat="server" ControlToValidate="txtftrusrname" Text="*" ValidationGroup="validaiton"/><br />
</FooterTemplate><br />
</asp:TemplateField><br />
<asp:TemplateField HeaderText="City"><br />
<EditItemTemplate><br />
<asp:TextBox ID="txtcity" runat="server" Text='<%#Eval("City") %>'/><br />
</EditItemTemplate><br />
<ItemTemplate><br />
<asp:Label ID="lblcity" runat="server" Text='<%#Eval("City") %>'/><br />
</ItemTemplate><br />
<FooterTemplate><br />
<asp:TextBox ID="txtftrcity" runat="server"/><br />
<asp:RequiredFieldValidator ID="rfvcity" runat="server" ControlToValidate="txtftrcity" Text="*" ValidationGroup="validaiton"/><br />
</FooterTemplate><br />
</asp:TemplateField><br />
<asp:TemplateField HeaderText="Designation"><br />
<EditItemTemplate><br />
<asp:TextBox ID="txtstate" runat="server" Text='<%#Eval("Designation") %>'/><br />
</EditItemTemplate><br />
<ItemTemplate><br />
<asp:Label ID="lblstate" runat="server" Text='<%#Eval("Designation") %>'/><br />
</ItemTemplate><br />
<FooterTemplate><br />
<asp:TextBox ID="txtftrDesignation" runat="server"/><br />
<asp:RequiredFieldValidator ID="rfvdesignation" runat="server" ControlToValidate="txtftrDesignation" Text="*" ValidationGroup="validaiton"/><br />
</FooterTemplate><br />
</asp:TemplateField><br />
</Columns><br />
</asp:GridView><br />
</div><br />
<div><br />
<asp:Label ID="lblresult" runat="server"></asp:Label><br />
</div><br />
</form><br />
</body><br />
</html></blockquote>
<br />
<b><u>Code Behind-:</u></b><br />
<b><u><br /></u></b>
<br />
<blockquote>
using System;<br />
using System.Configuration;<br />
using System.Data;<br />
using System.Data.SqlClient;<br />
using System.Drawing;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.HtmlControls;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Xml.Linq;<br />
public partial class _Default : System.Web.UI.Page<br />
{<br />
private SqlConnection con = new SqlConnection("Data Source=IT-HP\\sqlexpress;Initial Catalog=Employee;Integrated Security=True");<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (!IsPostBack)<br />
{<br />
BindEmployeeDetails();<br />
}<br />
}<br />
protected void BindEmployeeDetails()<br />
{<br />
con.Open();<br />
SqlCommand cmd = new SqlCommand("Select * from Employee_Details", con);<br />
SqlDataAdapter da = new SqlDataAdapter(cmd);<br />
DataSet ds = new DataSet();<br />
da.Fill(ds);<br />
con.Close();<br />
if (ds.Tables[0].Rows.Count > 0)<br />
{<br />
gvDetails.DataSource = ds;<br />
gvDetails.DataBind();<br />
}<br />
else<br />
{<br />
ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());<br />
gvDetails.DataSource = ds;<br />
gvDetails.DataBind();<br />
int columncount = gvDetails.Rows[0].Cells.Count;<br />
gvDetails.Rows[0].Cells.Clear();<br />
gvDetails.Rows[0].Cells.Add(new TableCell());<br />
gvDetails.Rows[0].Cells[0].ColumnSpan = columncount;<br />
gvDetails.Rows[0].Cells[0].Text = "No Records Found";<br />
} }<br />
protected void gvDetails_RowEditing(object sender, GridViewEditEventArgs e)<br />
{<br />
gvDetails.EditIndex = e.NewEditIndex;<br />
BindEmployeeDetails();<br />
}<br />
protected void gvDetails_RowUpdating(object sender, GridViewUpdateEventArgs e)<br />
{<br />
int userid = Convert.ToInt32(gvDetails.DataKeys[e.RowIndex].Value.ToString());<br />
string username = gvDetails.DataKeys[e.RowIndex].Values["UserName"].ToString();<br />
TextBox txtcity = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtcity");<br />
TextBox txtDesignation = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtstate");<br />
con.Open();<br />
SqlCommand cmd = new SqlCommand("update Employee_Details set City='" + txtcity.Text + "',Designation='" + txtDesignation.Text + "' where UserId=" + userid, con);<br />
cmd.ExecuteNonQuery();<br />
con.Close();<br />
lblresult.ForeColor = Color.Green;<br />
lblresult.Text = username + " Details Updated successfully";<br />
gvDetails.EditIndex = -1;<br />
BindEmployeeDetails();<br />
}<br />
protected void gvDetails_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)<br />
{<br />
gvDetails.EditIndex = -1;<br />
BindEmployeeDetails();<br />
}<br />
protected void gvDetails_RowDeleting(object sender, GridViewDeleteEventArgs e)<br />
{<br />
int userid = Convert.ToInt32(gvDetails.DataKeys[e.RowIndex].Values["UserId"].ToString());<br />
string username = gvDetails.DataKeys[e.RowIndex].Values["UserName"].ToString();<br />
con.Open();<br />
SqlCommand cmd = new SqlCommand("delete from Employee_Details where UserId=" + userid, con);<br />
int result = cmd.ExecuteNonQuery();<br />
con.Close();<br />
if (result == 1)<br />
{<br />
BindEmployeeDetails();<br />
lblresult.ForeColor = Color.Red;<br />
lblresult.Text = username + " details deleted successfully";<br />
} }<br />
protected void gvDetails_RowDataBound(object sender, GridViewRowEventArgs e)<br />
{<br />
<br />
if (e.Row.RowType == DataControlRowType.DataRow)<br />
{<br />
//getting username from particular row<br />
string username = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "UserName"));<br />
//identifying the control in gridview<br />
ImageButton lnkbtnresult = (ImageButton)e.Row.FindControl("imgbtnDelete");<br />
//raising javascript confirmationbox whenver user clicks on link button<br />
if (lnkbtnresult != null)<br />
{<br />
lnkbtnresult.Attributes.Add("onclick", "javascript:return ConfirmationBox('" + username + "')");<br />
} } }<br />
protected void gvDetails_RowCommand(object sender, GridViewCommandEventArgs e)<br />
{<br />
if(e.CommandName.Equals("AddNew"))<br />
{<br />
TextBox txtUsrname = (TextBox)gvDetails.FooterRow.FindControl("txtftrusrname");<br />
TextBox txtCity = (TextBox)gvDetails.FooterRow.FindControl("txtftrcity");<br />
TextBox txtDesgnation = (TextBox) gvDetails.FooterRow.FindControl("txtftrDesignation");<br />
con.Open();<br />
SqlCommand cmd =<br />
new SqlCommand(<br />
"insert into Employee_Details(UserName,City,Designation) values('" + txtUsrname.Text + "','" +<br />
txtCity.Text + "','" + txtDesgnation.Text + "')", con);<br />
int result= cmd.ExecuteNonQuery();<br />
con.Close();<br />
if(result==1)<br />
{<br />
BindEmployeeDetails();<br />
lblresult.ForeColor = Color.Green;<br />
lblresult.Text = txtUsrname.Text + " Details inserted successfully";<br />
}<br />
else<br />
{<br />
lblresult.ForeColor = Color.Red;<br />
lblresult.Text = txtUsrname.Text + " Details not inserted";<br />
} } } }</blockquote>
<div style="font-weight: bold; text-decoration: underline;">
<br /></div>
<div style="font-weight: bold; text-decoration: underline;">
<br /></div>
<br /></div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com0tag:blogger.com,1999:blog-3159271507854779946.post-21990064110567979262013-05-09T23:31:00.000-07:002013-05-09T23:31:01.668-07:00Validations in Javascript for Email and Phone no and allow onlynumbers in Asp.net<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<b><u>Code-:</u></b><br />
<br />
<blockquote class="tr_bq">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head id="Head1" runat="server"><br /><title>Vallidations Page</title><br /><script language="javascript" type="text/javascript"><br />function validate() {<br />var summary = "";<br />summary += isvalidFirstname();<br />summary += isvalidEmail();<br />summary += isvalidphoneno();<br />if (summary != "") {<br />alert(summary);<br />return false;<br />}<br />else {<br />return true;<br />}<br />}<br />function isvalidphoneno() {<br />var uid;<br />var temp = document.getElementById("<%=txtphone.ClientID %>");<br />uid = temp.value;<br />var re;<br />re = /^[0-9]+$/;<br />var digits = /\d(10)/;<br />if (uid == "") {<br />return ("Enter Ur Phone No." + "\n");<br />}<br />else if (re.test(uid)) {<br />return "";<br />}<br />else {<br />return ("Only Numbers Allowed" + "\n");<br />}<br />}<br />function isvalidFirstname() {<br />var uid;<br />var temp = document.getElementById("<%=txtfname.ClientID %>");<br />uid = temp.value;<br />var re=/^[a-zA-Z ]+$/<br />if (uid == "") {<br />return ("Enter First Name" + "\n");<br />}<br />else if (re.test(uid)) {<br />return "";<br />}<br />else {<br />return ("Characters and spaces only" + "\n");<br />}<br />}<br />function isvalidEmail() {<br />var uid;<br />var temp = document.getElementById("<%=txtEmail.ClientID %>");<br />uid = temp.value;<br />var re = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;<br />if (uid == "") {<br />return ("Please Enter Email" + "\n");<br />}<br />else if (re.test(uid)) {<br />return "";<br />}<br />else {<br />return ("Enter A valid Email" + "\n");<br />}<br />}<br /></script><br /></head><br /><body><br /><form id="form1" runat="server"><br /><table align="center"><br /><tr><br /><td><br /><asp:Label ID="lblfname" runat="server" Text="FirstName"></asp:Label><br /></td><br /><td><br /><asp:TextBox ID="txtfname" runat="server"></asp:TextBox><br /></td><br /></tr><br /><tr><br /><td><br /><asp:Label ID="Label1" runat="server" Text="Email"></asp:Label><br /></td><br /><td><br /><asp:TextBox ID="txtEmail" runat="server"></asp:TextBox><br /></td><br /></tr><br /><tr><br /><td><br /><asp:Label ID="lblCnt" runat="server" Text="Phone No"></asp:Label><br /></td><br /><td><br /><asp:TextBox ID="txtphone" runat="server"></asp:TextBox><br /></td><br /></tr><br /><tr><br /><td><br /></td><br /><td><br /><asp:Button ID="btnsubmit" runat="server" Text="Save"<br />OnClientClick ="javascript:validate()" /><br /></td><br /></tr><br /></table><br /></form><br /></body><br /></html></blockquote>
<br />
<b><u>Demo-:</u></b><br />
<b><u><br /></u></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiodCq9XxszaFlonT74OzPQ1GOsdeNk2f8QFHDbvL-fF33jQWUs2cWlWp2Ro2pZORO_O-Juw7KGk3q9O6DOZW-fULEW2rUL2n26Ro_zwWn3CwBLrkwAfiZQXAl_HaqTG_0arkW7s68DIDA/s1600/aaeeeww.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiodCq9XxszaFlonT74OzPQ1GOsdeNk2f8QFHDbvL-fF33jQWUs2cWlWp2Ro2pZORO_O-Juw7KGk3q9O6DOZW-fULEW2rUL2n26Ro_zwWn3CwBLrkwAfiZQXAl_HaqTG_0arkW7s68DIDA/s1600/aaeeeww.gif" height="305" width="320" /></a></div>
<br />
</div>
My Fitness Buckethttp://www.blogger.com/profile/09279520939744068864noreply@blogger.com3