Hi,

Still waiting for your reply...


On Mon, Jan 30, 2012 at 8:02 PM, Gourav <vishnoi.gou...@gmail.com> wrote:

> Dear All,
>
> I want to set Password when i am export data Grid View to Excel.My
> code are following.If there is any other mechanism for this task then
> please guide me.I'll be waiting for your helpful reply. Thanks in
> advance.
>
>
>
>
> -----------------------------------------------------------------------------------------------------------------------
>  protected void ExportExcel()
>    {
>        Response.ClearContent();
>        Response.AddHeader("content-disposition",
> "attachment;filename=AOPTownLevel.xls");
>        Response.ContentType = "application/ms-excel";
>        StringWriter sw = new StringWriter();
>        HtmlTextWriter htw = new HtmlTextWriter(sw);
>        HtmlForm frm = new HtmlForm();
>        GridView1.Parent.Controls.Add(frm);
>        frm.Attributes["runat"] = "server";
>        frm.Controls.Add(GridView1);
>        frm.RenderControl(htw);
>        Response.Write(sw.ToString());
>        Response.End();
>    }
>
>
> -----------------------------------------------------------------------------------------------------------------------




-- 
Warm Regards :-
Gourav Vishnoi
+91-9871157845 ( M )

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to dotnetdevelopment@googlegroups.com
To unsubscribe from this group, send email to
dotnetdevelopment+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to