Posts

Search data in Gridview on Textbox Key press event using JQuery in Asp.Net- C#

Image
First of all add the following .js file, Link and the JavaScript to your <Head> tag :: <head runat="server">     <title></title>    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript" src="js/quicksearch.js"></script> <script type="text/javascript">     $(function () {         $('.search_textbox').each(function (i) {             $(this).quicksearch("[id*=gvDetails] tr:not(:has(th))", {                 'testQuery': function (query, txt, row) {                     return $(row).children(":eq(" + i + ")").text().toLowerCase().indexOf(que...

Selecting GridView Row by clicking anywhere on the Row in Asp.Net - C#

Image
In this blog I am going to how to show how to select GridView Row when mouse is clicked anywhere on the GridView Row in ASP.Net- C#   First of all add a page to your solution and add a gridview, a link button which will be used to render ASP.Net _doPostBack JavaScript as it requires for RowSelection. <head runat="server">     <title></title> <style type="text/css">     body     {         font-family: Arial;         font-size: 10pt;     }     td     {         cursor: pointer;     }     .hover_row     {         background-color: #A1DCF2;     } </style>  <script type="text/javascript">      $(function () {  ...

Building Modal Popup using ASP.Net AJAX ModalPopupExtender Control

Image
In this blog I will explain with an example how to build a Modal Popup ASP.Net AJAX ModalPopupExtender control. First of all register the AJAX Control Toolkit Library by putting the following line just below the @PageDirective :: <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> Now add the following code inside the <body> tag :: <form id="form1" runat="server">     <asp:ScriptManager ID="ScriptManager1" runat="server">     </asp:ScriptManager>     <div>         <asp:Button ID="BtnShow" runat="server" Text="Show Modal PopUp" BackColor="Yellow"             BorderStyle="Groove" />         <asp:ModalPopupExtender ID="ModalPopupExtender1" PopupControlID="Panel1" TargetControlID="BtnShow" CancelControlID="BtnClose" Backgro...

Bind image in gridview and Show image on Hover over specific column in GridView (Show image as ToolTip on Mouseover in GridView) in Asp.Net C#

Image
In this blog, I am going to show how to bind images in gridview and show this image on mouseover over any link/ image         Here, i have have shown how a image can be used as a tooltip in gridview. First of all, Write the below code in .aspx page and don't forgot to add "jquery.tooltip.min.js" and "jquery-1.8.2.js" to your solution. Just search it on google and you will get this .js file easily <%@ Page Language="C#" AutoEventWireup="true" CodeFile="GridViewToolTipaspx.aspx.cs" Inherits="GridViewToolTipaspx" %> <!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>     <script src="http://code.jquery.com/jquery-1.8.2.js" type="text/javascript"></scri...

How to create PDF document in ASP.NET with C# using iTextSharp

In this blog I am going to explain how to create PDF document in ASP.NET using iTextSharp. First we have to download iTextSharp.dll class library and include to our project. You can download iTextSharp.dll class library here:: http://sourceforge.net/projects/itextsharp/ Then open your project and include that iTextSharp.dll class library. In Designer Source page just add a Gridview and button. Here i have added a button for generating pdf, an image source and a Gridview for storing data :: <div> <asp:Image ID="Image1" runat="server" Width="100%"             ImageUrl="https://www.google.co.in/images/srpr/logo11w.png"             Height="100%" /> </div>  <div>         <asp:GridView ID="gvDetails" runat="server" AlternatingRowStyle-BackColor="#FFFFCC">         ...

Code for Export data to excel, Sorting, Filtering and Paging GridView data in Aps.Net- c#

Place the whole code in .aspx page <%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewGridTest.aspx.cs" Inherits="NewGridTest"  EnableEventValidation="false"%> <!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>         <div>             <asp:GridView ID="gvDetails" runat="server" AutoGenerateColumns="False"                 Font-Names="Verdana" AllowPaging="True" AlternatingRowStyle-BackColor="#EFF3FB" AllowSorting="True" PageSize="5" Width="40%"     ...

Code for Data Export from GridView to Excel in Asp.Net- c#

In this blog, I am going to show how we could export our data from a gridview to excel sheet in Asp.net- c# (Export to excel data) First of all, just take a gridview on your design page and fill data as below :: protected void Page_Load(object sender, EventArgs e)     {         if (!IsPostBack)         {            BindGrid();         }     }     protected void BindGrid()     {         gvDetails.DataSource = this.getData();         gvDetails.DataBind();     }     private DataTable getData()     {         DataTable dt = new DataTable();         dt.Columns.Add("UserId", ...
go to top image