[ mii @ 01.10.2007. 15:04 ] @
Pozdrav svima! treba da prebacim sadrzinu datagrida u excel, i to mi radi ok,medjutim kada imam drugi datagrid sa linkbutton edit , update,cancel onda ne mogu da prebacim u excel,kaze: Control 'DataGrid1_ctl02_ctl01' of type 'DataGridLinkButton' must be placed inside a form tag with runat=server. evo koda: public void AddAuthor_Click1(Object sender, EventArgs E) { Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=FileName.xls"); Response.Charset = ""; Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.ContentType = "application/vnd.xls"; System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); DataGrid1.RenderControl(htmlWrite);////ovdje javlja gresku!!!! Response.Write(stringWrite.ToString()); Response.End(); } Hvala unaprijed! |