ASP Snippets

Categories






Alerts

Free Alerts

Your email will always be
private and will not be shared.




Follow us on twitter.


Welcome to

Welcome to ASP Snippets

Featured Snippet


Excel like AutoFilter Feature in ASP.Net GridView Control
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)RSS comment feed | Filed under : ASP.Net | C# | GridView | VB.Net



Recently Added






Most Viewed


Excel like AutoFilter Feature in ASP.Net GridView Control

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>     ... [More]

Posted: Nov 26 2009, 23:03 by Mudassar Khan | Comments(3)RSS comment feed | Filed under : ASP.Net | C# | GridView | VB.Net

Export GridView To Word/Excel/PDF/CSV in ASP.Net

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)RSS comment feed | Filed under : ASP.Net | C# | VB.Net | GridView

Save and Retrieve Files from SQL Server Database using ASP.Net

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)RSS comment feed | Filed under : ADO.Net | C# | SQL Server | VB.Net

Display Images from Database using ASP.Net

How 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)RSS comment feed | Filed under : ADO.Net | C# | SQL Server | VB.Net

Send Email using CSharp

Namespaces The following Namespaces need to be imported in order to send emails using System.Net; using System.Net.Mail; MailMessage Class Properties Following are the required properties of the mail message class. From – Sender’s email address To – Recipient(s) Email Address CC – Carbon Copies BCC – Blind Carbon Copies Subject – Subject of the Email  Body – Body of the Email IsBodyHtml – Specify whether body contains text or HTML mark up. Attachments – Attachments if Any. ReplyTo – ReplyTo Email address. Creating a MailMessage Object MailMessage mm = new MailMessage(); mm.From = new MailAddress("username@gmail.com"); ... [More]

Posted: Feb 01 2009, 04:21 by Mudassar Khan | Comments(3)RSS comment feed | Filed under : C#














Community News





Web Hosting SpotLight


Consulting


For consulting and work related queries click here.



Advertise


Advertise with us. For more details click here.


Suggestions


Please provide your valuable suggesstions here.

This Site is hosted on

Lunarpages.com Web Hosting



ASP.NET Docs Style Guide

This document provides an overview of how articles published on docs.asp.net should be formatted. You can actually use this file, itself, as a template when contributing articles. Sections: ...


Getting started with ASP.NET Core MVC and Visual Studio

This tutorial will teach you the basics of building an ASP.NET Core MVC web app using Visual Studio 2015 . Install Visual Studio and .NET Core ¶ Install Visual Studio Community 2015. Sel...


Building Your First Web API with ASP.NET Core MVC and Visual Studio

HTTP is not just for serving up web pages. It’s also a powerful platform for building APIs that expose services and data. HTTP is simple, flexible, and ubiquitous. Almost any platform that you can ...


Logging

ASP.NET Core has built-in support for logging, and allows developers to easily leverage their preferred logging framework&#8217;s functionality as well. Implementing logging in your application req...


Enabling authentication using external providers

This tutorial shows you how to build an ASP.NET Core app that enables users to log in using OAuth 2.0 with credentials from an external authentication provider, such as Facebook, Twitter, LinkedIn...


Configuration

Steve Smith , Daniel Roth ASP.NET Core supports a variety of different configuration options. Application configuration data can come from files using built-in support for JSON, XML, and INI fo...


Safe storage of app secrets with the Secret Manager tool

This document shows how you can use the Secret Manager tool to keep secrets out of your code. The most important point is you should never store passwords or other sensitive data in source code, an...


Introduction to Data Protection

Web applications often need to store security-sensitive data. Windows provides DPAPI for desktop applications but this is unsuitable for web applications. The ASP.NET Core data protection stack prov...


Controllers, Actions, and Action Results

Actions and action results are a fundamental part of how developers build apps using ASP.NET MVC. Sections: What is a Controller Defining Actions What is a Controller ¶ I...


Middleware

Sections: What is middleware Creating a middleware pipeline with IApplicationBuilder Built-in middleware Writing middleware Additional Resources View or download samp...


Migrating from ASP.NET 5 RC1 to ASP.NET Core

Sections: Overview Creating your web application host WebHostBuilder API updates IHostingEnvironment changes Runtime Services Changes Namespace and package ID changes ...


Building Beautiful, Responsive Sites with Bootstrap

Bootstrap is currently the most popular web framework for developing responsive web applications. It offers a number of features and benefits that can improve your users&#8217; experience with your...


Introduction to ASP.NET Core

ASP.NET Core is a significant redesign of ASP.NET. This topic introduces the new concepts in ASP.NET Core and explains how they help you develop modern web apps. Sections: What is ASP.NET ...


Working with Static Files

Static files, which include HTML files, CSS files, image files, and JavaScript files, are assets that the app will serve directly to clients. In this article, we&#8217;ll cover the following topics...


Working with Multiple Environments

ASP.NET Core introduces improved support for controlling application behavior across multiple environments, such as development, staging, and production. Environment variables are used to indicate ...


Deploying ASP.NET Core Applications

[video] It's a whole new world: support for Linux in Azure and cross-platform support for the next version of ASP.NET. This session will demonstrate a variety of options and techniques to deploy AS...


ASP.NET Core Deep Dive into MVC

[video] In this presentation learn all about ASP.NET Core and including the latest features and innovations in MVC. You’ll see how you can build applications that run cross-platform on Windows, Mac...


Introducing ASP.NET Core 1.0

[video] Come join Scott Hanselman and Scott Hunter and learn about the groundbreaking changes in ASP.NET. For the first time ever ASP.NET is supported on Windows, Mac and Linux with a fully cross-p...


Visual Studio Code

Build and debug modern web and cloud applications with Visual Studio Code. Code is free and available on your favorite platform - Linux, Mac OS X, and Windows.


Introduction to Tag Helpers

Tag Helpers enable server-side code to participate in creating and rendering HTML elements in Razor files.