Showing posts from June, 2010

How to hide generated javascript file in visual studio code

In this post I am going to show you a cool trick in visual studio code. Let's suppose you are writing typescript code in visual studio code and you want to hide generated javascript code.

Create .vscode folder in your folder and then create settings.json file and paste following code

{ "files.exclude": { "node_modules":true, "**/.git": true, "**/.DS_Store": true, "**/*": true, "**/*.js": {"when": "$(basename).ts"}     } }

How to add tool tip for Dropdownlist Item in

In this post i am going to show you how to add tool tip for dropdownlist item in

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ToolTip_DropDownList.aspx.cs" Inherits="ToolTip_DropDownList" %><!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN"""><htmlxmlns=""><headrunat="server"><title></title></head><body><formid="form1"runat="server"><div><asp:DropDownListID="ddlDemo"runat="server"><asp:ListItemText=""Value="ASP.NET, the next version of ASP, is a programming framework used to create enterprise-class Web Applications"/><asp:ListItemText="C#"Value="C# (pronounced C-sharp) is an object-oriented programming language from Microsoft"/><…

How to add Ajax activity indicator while calling webservice in

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JqueryLoader.aspx.cs" Inherits="JqueryLoader" %><!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN"""><htmlxmlns=""><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"""><htmlxmlns=""><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"""><htmlxmlns=""><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

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 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"""><htmlxmlns=""><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…