Posts

Showing posts from January, 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, "**/*.js.map": true, "**/*.js": {"when": "$(basename).ts"}     } }

How to restrict download of specified file types in asp.net

In this post i will show you how to restrict your web app so that .txt (whatever file extensions you want ) files can not be downloaded. Open your web.config file and register following setting in your web.config <system.web><httpHandlers><addverb="*"path="*.txt"type="System.Web.HttpForbiddenHandler"/></httpHandlers></system.web> For more details how to register handler in web.config check out this link

How to animate grdivew using Jquery

Image
<%@ 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"><title></title><scriptsrc="Scripts/jquery-1.3.2.js"type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $('#<%=ddlCategory.ClientID %>').change(function() { var categoryid = $('#<%=ddlCategory.ClientID %>').val(); $.ajax( { type: "POST", dataType: "json", contentType: "application/json", data: "{'CategoryID':'…

GridView row double click and postback using Jquery

Image
<%@ 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"><styletype="text/css"> .selected { background-color: Red; } </style><scriptsrc="Scripts/jquery-1.3.2.js"type="text/javascript"></script> <title></title> <script type="text/javascript"> var selected = null; $(document).ready(function(){ $("#<%=GridView1.ClientID %>").find("tr").click(function(){ $(selected).removeClass("selected"); $(this).addClass("selected"); selected = this; }); $("#<%=GridView1.Cl…

How to get cell value of gridview using JQUERY

Image
<%@ 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"><title></title><scriptsrc="Scripts/jquery-1.3.2.js"type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { var list = ""; $("#btnGet").click(function() { $("#<%=GridView1.ClientID %> tr").each(function() { //Skip first(header) rowif (!this.rowIndex) return; var age = $(this).find("td:last").html(); list += age + "</br>"; }); …

How To change the color of gridview row on mouseover using JQUERY

Image
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.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"><headid="Head1"runat="server"><title></title><scriptsrc="Scripts/jquery-1.3.2.js"type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $("#<%=GridView1.ClientID%> tr").filter(function() { return $('td', this).length && !('table', this).length }).hover ( function() { $(this).css("background-color", "red") }, function() { $(this).css("background-…