Skip to main content

Hello Friends

This is an important moment for me! This is the first blog I’ve ever written. It’s something I’ve wanted to do for a long time, but wasn’t sure how to do it, where, when, or even if. And finally, now here I am. People say that blogs are like a diary (do I hide it under my bed, lock it with a key? Tell it all my secrets? It seems like a wonderful place to share my thoughts with you, or what I do.) It’s going to be fun sharing my thoughts with you, outside the context of a book. Ok let me tell you about myself. I am a I.T Engineer and having 2 year experience about the I.T Sector. After Completion of my graduation i worked as a "Web Designer" for 1.3 years then i Switch my profile to software engineer and I am working as a Software engineer from 6 months. so basically my blogs are all bout to the new technologies, interesting and important codes and some useful resources. For more about myself please visit my website: http://www.lokeshchadha.co.cc/.

1)..Downloading a File with a Save As Dialog in ASP.Net

Here i am pointing about how to automaticaly open a Save As dialog on a link click. Very useful to download attachments.

I'd just like to add that IE and FireFox have different handling with non ASCII characters that we can use in my french country for instance... IE doesn't like those chars, so you have to URLEncode it. But when URLEncoded, FireFox doesn't catch it, and keeps '+' chars instead of spaces...

The solution is simple.. you just have to check the client browser :

public static void PrepareAttachmentReponse(HttpContext context, string filename)

{

if (context.Request.Browser.Browser == "IE")

filename = context.Server.UrlPathEncode(filename);

// send response

context.Response.AppendHeader("Content-Disposition", "attachment; filename=\"" + filename + "\"");

}

And that's it.

Comments

Popular posts from this blog

10 jQuery Custom Scrollbar Plugins

10 jQuery Custom Scrollbar Plugins If you ever wanted to add some custom scrollbars to your website, to scroll the contents and the default browser scrollbars just doesn’t match up with your design, than make sure you check this list of 10 jQuery custom scrollbar plugins. Hope you find the following information helpful. 1. jScrollPane – custom cross-browser scrollbars Kelvin Luck’s jScrollPane was originally developed in December 2006. It is a jQuery plugin which provides you with custom scrollbars which work consistently across all modern browsers. You can style the scrollbars using simple CSS and they degrade gracefully where JavaScript is disabled. 2. Plugin JQuery : Scrollbar This page is written in french so use Google’s translate service to translate this page to your preferred language. Download is available for the plugin.  The purpose of this plugin is to add a scrollbar to the item of your choice, to view any content which is larger than the size – vizibl...

connect ftp with gridview / display files in gridview from ftp or server

HTML Markup Below is the HTML Markup of the page, where I have an ASP.Net control  FileUpload  to upload files, a  Button control to trigger file uploads and an ASP.Net GridView control to display the files from folder. < asp : FileUpload   ID ="FileUpload1"   runat ="server"   /> < asp : Button   ID ="btnUpload"   runat ="server"   Text ="Upload"   OnClick ="UploadFile"   /> < hr   /> < asp : GridView   ID ="GridView1"   runat ="server"   AutoGenerateColumns ="false"   EmptyDataText   =   "No files uploaded">      < Columns >          < asp : BoundField   DataField ="Text"   HeaderText ="File Name"   />          < asp : TemplateField >              < ItemTempla...

Step by step installation guide for SQL Server 2012

I have so exciting news! Microsoft has released  SQL Server 2012  RTM (Code name  “Denali” ) on March 6 for manufacturing and download the evaluation edition from  http://www.microsoft.com/download/en/details.aspx?id=29066 As my laptop is 32-bit system, so I have downloaded the following files from the above link. Likewise, you can download the files for 64-bit system(x64) too. :) Finally, check your system requirements from the same link. ENU\x86\SQLFULL_x86_ENU_Core.box ENU\x86\SQLFULL_x86_ENU_Install.exe ENU\x86\SQLFULL_x86_ENU_Lang.box After downloading the above files, your system will look like below: Double click the  “SQLFULL_x86_ENU_Install.exe” , it will extract the required files for installation in the “SQLFULL_x86_ENU”  folder as shown below: Click the  “SQLFULL_x86_ENU”  folder and double click  “SETUP”  application. Checking your system requirements for installation. When you see  “SQL Server Installation Center” ...