Author:Mudassar Khan
Here Mudassar Ahmed Khan has explained how to add Excel like AutoFilter feature in ASP.Net GridView Control using DropDownList
Here I am explaining how to build a feature similar to Microsoft’s Excel AutoFilter in ASP.Net GridView control. Excel AutoFilter allows user to filter the records using the DropDownList in the header, so lets start with the tutorial
GridView Markup
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns = "false"
AllowPaging = "true" PageSize = "10" Font-Names = "Arial"
Font-Size = "11pt" AlternatingRowStyle-BackColor = "#C2D69B"
HeaderStyle-BackColor = "green" OnPageIndexChanging = "OnPaging">
<Columns>
<asp:BoundField DataField="ContactName" HeaderText="Contact Name" />
<asp:BoundField ...
[More]Posted: Nov 26 2009, 23:03 by Mudassar Khan | Comments(3)
| Filed under : ASP.Net | C# | GridView | VB.NetRecently Added
Most Viewed
Here Mudassar Ahmed Khan has explained how to export GridView to Word, Excel, PDF and CSV documents
In this article, I will explain how to export GridView to Word, Excel, PDF and CSV formats.
Exporting to Word, Excel and CSV can be easily achieved using ASP.Net without any third party tools, but for exporting GridView to PDF I am using iTextSharp which is a free library for exporting html to PDF.
To start with I have a GridView in which I am showing Customers records from the NorthWind Database.
The HTML markup of the GridView is as shown below
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns = "false" Font-Names = "Arial"
Font-Size = "11pt" ...
[More]Posted: Mar 14 2009, 23:11 by Mudassar Khan | Comments(185)
| Filed under : ASP.Net | C# | VB.Net | GridView
Files can be easily saved in the SQL Server Database Saving it in database makes it easily manageable.
Here I will explain how to save and retrieve files from database.
Database Design
Here I have created a Database called dbFiles and it has a table called tblFiles.
It has 4 Fields. The complete description is available in the Figure below
As you can see above for the id field I have set Identity Specification true, so that it automatically increments itself.
Field
Relevance
id
Identification Number
Name
File Name
Content ...
[More]Posted: Feb 19 2009, 04:49 by Mudassar Khan | Comments(118)
| Filed under : ADO.Net | C# | SQL Server | VB.NetHow to retreive images saved in database and display them using ASP.net Image Control
In my previous article I explained Save and Retrieve Files from SQL Server Database using ASP.Net.
Here I will explain how to display images that are saved in database.
I have saved images of three different formats i.e. JPEG, GIF and PNG in the Database.
Refer figure below.
Retreive the Images
To retreive pictures from database I have created a Picture Page. The page will receive ImageID as the ID of the Saved image as QueryString Parameter.
Based on the QueryString Parameter, the page will retreive the image and write it to the Response. Refer the Code Below
C# [ImageCSharp.aspx]
protected void Page_Load(object sender, EventArgs ...
[More]Posted: Feb 21 2009, 03:39 by Mudassar Khan | Comments(19)
| Filed under : ADO.Net | C# | SQL Server | VB.NetHere Mudassar Ahmed Khan has discussed how to disable browser back button functionality in ASP.Net using JavaScript
In this article, I am discussing how to prevent user from navigate to previous page using back button of the browser or the back option in the context menu.
One cannot disable the browser back button functionality only thing that can be done is prevent them.
Below is the JavaScript snippets that needs to be placed in the head section of the page where you don’t want the user to revisit using the back button
<script type = "text/javascript" >
function preventBack(){window.history.forward();}
setTimeout("preventBack()", 0);
window.onunload=function(){null};
</script>
Suppose ...
[More]Posted: Mar 24 2009, 03:37 by Mudassar Khan | Comments(44)
| Filed under : JavaScriptHere Mudassar Ahmed Khan has explained the concepts to get the GridView row reference when the control inside the GridView Row fires the event. In addition he has also explained how to pass multiple values through the CommandArgument Property
Here I am explaining how to get the reference of the GridView Row and also the GridView Row Index when Button, ImageButton, or LinkButton is clicked or RowCommand Event is fired. In addition to that I will also explain how to add multiple CommandArguments to Control in GridView and retrieve the same.
Get GridView Row and GridView Row Index on RowCommand Event
Below is a simple ASP.Net GridView Control with a ButtonField and an OnRowCommand Event
<asp:GridView ID="GridView1" ...
[More]Posted: Jun 27 2009, 04:20 by Mudassar Khan | Comments(10)
| Filed under : ASP.Net | C# | GridView | VB.Net