Skip to main content

Posts

How to add Ajax activity indicator while calling webservice in asp.net

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JqueryLoader.aspx.cs" Inherits="JqueryLoader" %><!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server"><scriptsrc="Scripts/jquery-1.3.2.js"type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $("#ajaxStatus").ajaxStart(function() { $(this).show(); }).ajaxStop(function() { $(this).hide(); }); // Start our ajax request when doAjaxButton is clicked $('#AjaxButton').click(function() { $.ajax({ type: 'POST', url: 'JqueryLoader.aspx/H…

Gridview and Jquery Confirm

In this post i am going to show you how to add pop-up (confirm)  window that ask user to confirm if they want to delete this row or not.


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GridViewConfirm.aspx.cs" Inherits="GridViewConfirm" %><!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server"><title></title><scriptsrc="Scripts/jquery-1.3.2.js"type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { //To remove the row on click on click of the row $("#<%=grdStudent.ClientID%> tr").click(function() { //Get confirmation from the uservar answer = confirm('Are you sure you want to dele…

Flash message using Jquery

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FlashMessage.aspx.cs" Inherits="FlashMessage" %><!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server"><title></title><styletype="text/css"> .style1 { width: 100%; } </style><scriptsrc="Scripts/jquery-1.3.2.js"type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $("#btnInsert").click(function() { var name = $("#txtName").val(); var age = $("#txtAge").val(); $.ajax( { type: "POST", data: &qu…

jQuery Autocomplete and ASP.NET

In this post i am going to show how to use jquery Autocomplte plugin in asp.net.



Open Microsoft Visual Studio .NET. In Visual C# .NET, create a new WebSiteRight click on new website and add a new class(DummyDAL.cs) in App_Code folder and copy the following code
using System; using System.Collections.Generic; using System.Linq; using System.Web; publicclass Country {     publicint ID { get; set; }     publicstring CountryName { get; set; }     public System.Collections.Generic.List<Country> GetList()     {         System.Collections.Generic.List<Country> list = new System.Collections.Generic.List<Country>()         {             new Country(){ID=1,CountryName="Inida"},             new Country(){ID=1,CountryName="Indonesia"},             new Country(){ID=2,CountryName="USA"},             new Country(){ID=3,CountryName="UK"},             new Country(){ID=4,CountryName="Australia"},             new Country(){ID=5,Country…

Photoalbum using ListView and Lightbox jquery plugin

In this post i am going to show you how to create a simple photo album in asp.net using ListView and Jquery Lightbox plugin


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server"><scriptsrc="Scripts/jquery-1.3.2.js"type="text/javascript"></script> <script src="Scripts/jquery.lightbox-0.5.js" type="text/javascript"></script> <link href="css/jquery.lightbox-0.5.css" rel="stylesheet" type="text/css" /> <title></title> <style type="text/css"> .productlist li { dispaly: inline; float: left; …

How to use Schtasks.exe to Schedule Tasks in Windows

This particular code is about a pretty common functionality which I think most of the software engineers face in their projects. Even I came across the same situation many times. Previously I used to achieve the functionality via Window Service, which really worked perfectly. But in this post i am going to achieve the same goal using Window Scheduler.




using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; using System.IO; namespace ScheduleDemo_CS {     class Program     {         publicstaticreadonlystring Constans = "SCHTASKS.exe";         staticvoid Main(string[] args)         {             CreateScheduleTask("MINUTE", 1, "aspdotnetcodebook", @"C:\Windows\System32\notepad.exe");         }         publicstaticbool CreateProcess(string strProcessName, string strCommandLineParams)         {             // set process parameters and invoke the process             ProcessStartInfo processIn…

How to bind Gridview using Linq (Join) and access the value of gridview cell

In this post i am going to show how to read the value of GridView cell when the DataSource is anonymous type.


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %><!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server"><title></title></head><body><formid="form1"runat="server"><div></div><asp:GridViewID="GridView1"runat="server"OnRowDataBound="GridView1_RowDataBound"></asp:GridView></form></body></html>
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; publicpartialclass Default3 : System.Web.UI…