Category : Uncategorized

 Get and set name of the button using jQuery <html> <head> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { //seeting value of the button name $('#btnName').val("Submit button"); //getting value of the button name. alert($('#btnName').val()); }); </script> </head> <body> <input type="button" id="btnName" /> </body> </html&..

Read more

 How to remove div content using html() in jQuery or remove and add content to the div using jQuery html <html> <head> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#btnChangetext').click(function() { //remove the div content $("#RemovingContent").children().remove(); $("#RemovingContent").html(""); //adding content to div $("#RemovingContent").html("<a href=www.sourcecodehub.com>www.sourcecodehub.com</a>"); //you can also add one more div to #RemovingContent $("<div>hello</div>").appendTo($("#RemovingContent")); }); ..

Read more

 Scroll to top link using jQuery or Back to Top link using jQuery <html> <head> <title></title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('a[href=#top]').click(function() { $('html, body').animate({ scrollTop: 0 }, 'slow'); return false; }); }); </script> </head> <body> <div id="top"></div>this is sample example for going to top from botton of blog <br /><br /><br /><br ..

Read more

 jQuery UI Auto completion with example <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title></title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"></script> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/themes/base/jquery-ui.css" type="text/css" media="all" /> <style type="text/css"> li.ui-menu-item { font-size: 25px; font-family: arial; } </style> </head> <body> <h3> Enter theEmployee name: </h3> <input type="text" id="book" /> <script type="text/javascript"> // array of ..

Read more

Default.aspx code:- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default6.aspx.cs" Inherits="Default6" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <table style="width: 100%;"> <tr> <td> &nbsp; Select Below Date: <asp:TextBox ID="txtDate" runat="server" ></asp:TextBox> </td> <td> &nbsp; </td> <td> &nbsp; </td> </tr> <tr> <td> &nbsp; <asp:Calendar ID="calControl" runat="server" ..

Read more

 ASP.NET AJAX Accordion Control Example <%@ Page Language="C#" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .AccordionMain { width: 500px; height:500px; } .AccordionHeader { border: 1.5px solid #2F4F4F; color: white; background-color: #2E4E7B; font-family: Sans-Serif; font-size: 11px; font-weight: bold; ..

Read more

 ASP.NET AJAX TextBox Watermark Control Example <%@ Page Language="C#" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .WaterMarkClass { background-color: #EaEaEa; border: solid 0.5px #818181; padding: 3px; } .WithOutWaterMark { border: solid 1.5px #818181; padding: 3px; } </style> ..

Read more

Note: Add the Ajaxtoolkit DLL using Visual Nugget Manager AJAX AlwaysVisibleControlExtender Example using ASP.NET <%@ Page Language="C#" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <asp:Panel ID="Panel1" runat="server" BackColor="Blue" BorderColor="Black" BorderStyle="Solid" ..

Read more

ASP.NET AJAX UpdateProgress Control Example with UpdatePanel <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void btnSubmit_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(2000); } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .auto-style1 { width: 638px; height: 256px; } .auto-style2 { width: 48%; height: 256px; } </style> </head> <body> ..

Read more

Reading ASP.NET drop down values using JQuery <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title> </title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" ></script> <script type="text/javascript"> $(document).ready(function () { $('#txtLanguage').hide(); $('#ddlTeste').change(function () { var txtLanguage = $('#txtLanguage'); var testvalues = $("#ddlTeste option:selected").text(); if (testvalues) { txtLanguage.show(); txtLanguage.val(testvalues); } else txtLanguage.hide(); }); }); </script> ..

Read more