In this article, we see how to provide a download option (say for example to download images) to the users of our website. In accomplishing the requirement we use a Generic HttpHandler – which handles all the requests made for the download. For demonstration purpose we take some images and display them using a Datalist, in which we do provide an option to download. On download option click, the generic handler will process the request and displays an dialog in the client questioning client either to save or open the file, accordingly corresponding action will be taken place.
Most Popular (Last 7 days)
- How to send an Email using C# - complete features
- Sending Automated Emails asynchronously using a C# Windows Service in conjunction with Database Email records PART - II
- JQuery POST & GET Request to WCF Service in ASP.Net MVC
- Create a Simple WCF service against Pubs Database using EF, LINQ – Part I
- Sending Automated Emails asynchronously using a C# Windows Service in conjunction with Database Email records – Part I
- Create a Simple WCF Service Client against Pubs Database using EF, LINQ – Part II
- Access Code-behind variables in ASPX and JavaScript
- Simple Html Editor based Comments Section with Captcha feature along with Database Interactivity
- ASP.Net MVC–Simple Application Security using Password Hashing before storing it to Database
- Access JavaScript Variables in Code-Behind Class
Most Popular (All time)
- How to send an Email using C# - complete features (29548 views )
- Sending Automated Emails asynchronously using a C# Windows Service in conjunction with Database Email records PART - II (18382 views )
- Create a Simple WCF service against Pubs Database using EF, LINQ – Part I (11907 views )
- JQuery POST & GET Request to WCF Service in ASP.Net MVC (11802 views )
- Access Code-behind variables in ASPX and JavaScript (11348 views )
- Sending Automated Emails asynchronously using a C# Windows Service in conjunction with Database Email records – Part I (11262 views )
- Create a Simple WCF Service Client against Pubs Database using EF, LINQ – Part II (9231 views )
- Access JavaScript Variables in Code-Behind Class (8631 views )
- Simple Html Editor based Comments Section with Captcha feature along with Database Interactivity (8148 views )
- Data Transfer between two ASP.NET Pages (7873 views )
- Save the World (6709 views )
- Retrieve files from a table in Database using Generic Handler (5646 views )
- Save files to a table in Database using FileUpload control (5521 views )
- ASP.Net MVC–Simple Application Security using Password Hashing before storing it to Database (5326 views )
- How to download files from server to client using a Generic Handler (4340 views )
- AJAX HTML Editor based Contact Form inside UpdatePanel along with UpdateProgress (4263 views )
- JQuery Quickies #1 – GalleryView Plugin by Jack Anderson (3816 views )
- Book Review - MCTS Exam 70-536 Microsoft .NET Framework – Application Development Foundation Self Paced Training Kit - Tony Northrup (3490 views )
- Implementing MVP Pattern using UserControls with WCF Database Operations in Entity Framework and LINQ – PART I (3352 views )
- File Download by Anil (3330 views )
JumpStart Tutorials
- JumpStart # 11 - Xml Comments for code using GhostDoc Extension
- JumpStart # 10 – Display Validation Error Messages in different formats using JavaScript
- JumpStart # 9 – Make Response.Redirect() open in New Blank Window
- JumpStart # 8 – Making Client CallBacks by Implementing ICallBackEventHandler Interface
- JumpStart # 7 – Handling UserControl’s Event from Parent Page
- JumpStart # 6 – Accessing CheckBoxList Control in JavaScript and making a Mandatory Selection Enabled
- JumpStart # 5 – Access Properties of a UserControl from other UserControl in ASP.Net Page
- JumpStart # 4 – validateRequest in ASP.Net
- JumpStart # 3 – ViewStateMode in ASP.Net 4.0
- JumpStart # 2 – OUT Parameter in C#
- JumpStart # 1 - Using Optional And Named Parameters in C#
Latest Entries
How to download files from server to client using a Generic Handler
RamiVemula on August 31, 2010 at 7:37 pm
Simple Html Editor based Comments Section with Captcha feature along with Database Interactivity
RamiVemula on August 29, 2010 at 7:32 pm
In this tutorial, we see how to develop a simple comments section. This comments section is going to be a similar one to what we usually see in our day to day experience. Here we use TinyMCE editor to enable Html Comments. And also catpcha is enabled (with the help of reCaptcha of Google). The basic outline would be – Users provide their general details like name and email, and also they can provide Html Comment (using TinyMCE), and finally they should enter the text showed in the captcha for validating robots. Then we take the Html string, encode it using HtmlEncode(), store it in database. Finally we retrieve the encoded string from the database, we then decode it and display it in the page as Comment.
Sending Automated Emails asynchronously using a C# Windows Service in conjunction with Database Email records PART – II
RamiVemula on August 23, 2010 at 1:03 am
In this part of the tutorial, we first create a Windows Service Project, then implement a Service called – ‘BirthdayEmailService’. Then we add a reference to our previously created Class Library – ‘EmailComponent’. We code BirthdayEmailService using Timer to perform the email sending task for every hour. Then we incorporate the Installer classes for the purpose of installation. Finally a Setup and Deployment Project is created for the Service. Finally the complete Solution is build and the exe file is generated which is ready enough to get installed.
Sending Automated Emails asynchronously using a C# Windows Service in conjunction with Database Email records – Part I
RamiVemula on August 23, 2010 at 1:00 am
In this tutorial, we learn how to send automated birthday wish emails to the customers of our product. We first design our database with basic details of every customer, and of course with a Email address field. Then we create a class library to hold the classes of database interactivity and to send email asynchronously. We use ADO.Net (for this tutorial I am skipping Entity Framework implementation, which usually I prefer to interact with Database. For generating EF modules of database, kindly watch this tutorial – Click Here) with a stored procedure for database interaction (primarily to fetch email ids of customers to whom we got to send birthday wishes). Then finally we use a Windows Service (which obviously run background in the server)through which the previously created class library is accessed and async emails are send.
Create a Simple WCF Service Client against Pubs Database using EF, LINQ – Part II
RamiVemula on August 10, 2010 at 9:25 pm
1) In this tutorial (which is PART – II), we create a small website in ASP.Net 4.0 and we shall use a WebForm (named: PubsServiceTestPage.aspx) as a client to our service (which we created in former tutorial).
2) We Use the inline model of Webform (not the codebehind model).
3) We perform the actions using our client like, Getting all the Authors and display them in the Dropdownlist for selections, Selecting a Author and display his corresponding books using a Repeater, Modify and save the book details back to database etc.
4) To test the Client, we need the service to be running in the server, that can be simply manipulated by starting another instance of VS 2010 and running (Ctrl + F5) the PubsService.svc.cs.
Filed under:ARTICLE, C#, Entity Framework, LINQ
Create a Simple WCF service against Pubs Database using EF, LINQ – Part I
RamiVemula on August 10, 2010 at 7:56 pm
1) In this tutorial we create a simple WCF service which is used to retrieve and save data from Pubs Database (Microsoft sample database).
2) The service also demos on how to use EF 4.0 and LINQ against database coding, with no requirement of writing SQL queries.
3) The continuation of this tutorial shows on how to create a client (say a WebForm in a website) to utilize this service.
Filed under:ARTICLE, C#, Entity Framework, LINQ
JumpStart # 4 – validateRequest in ASP.Net
RamiVemula on May 17, 2010 at 7:36 pm
validateRequest –
1. It is feature which is responsible for the page not submitting un-encoded html or script as input
in asp.net.
2. When user try to submit html or script with validateRequest enabled, asp.net throws an exception -
“A potentially dangerous Request.Form value was detected from the client”.
Data Transfer between two ASP.NET Pages
RamiVemula on March 15, 2010 at 11:53 am
In most of the present day Web Applications, it is required to transfer data from one web page to another web page. Requirements like maintaining user preferences across the application, identifying user between transactions, correlating data based on previous page options etc, always drive programmers to write code to transfer data from page to page.
There are numerous ways in accomplishing the above said tasks, selecting an appropriate way for an appropriate situation is vested in the hands of programmer. Some of the most prominent techniques, out of my knowledge are listed in this article. Read More…
Filed under:ARTICLE
Access JavaScript Variables in Code-Behind Class
RamiVemula on January 24, 2010 at 7:29 pm
After writing the article on how to “Access Code-Behind variables in ASPX and JavaScript”, my focus continued on this particular counteract concept. At times we got to transfer some data from client side JavaScript to code-behind on some particular requirements. For example when the screen resolution of the client’s web browser is needed to be known in code-behind, then the simple way to accomplish is to access JavaScript variable in Code-Behind.Read More…
Filed under:ARTICLE
Access Code-behind variables in ASPX and JavaScript
RamiVemula on January 1, 2010 at 11:45 am
I often come across this question not only in the Worldwide Web but also in many development scenarios. In fact this is the question which I faced when I started programming years back. At times we need to change some of the properties of the server side controls from code-behind partial class and also sometimes we are required to process some data on the client side JavaScript which we get from code-behind. In those cases, accessing code-behind variables in ASPX is the easiest way to get our job done.Read More…
Filed under:ARTICLE






