Archive

Posts Tagged ‘Codebehind’

CSS missing while using Response.Write in ASP.NET page

December 15th, 2009 Shyju No comments

When you are using response.write in your server side code behind page (C# or vb) for an ASP.NET page,The styles of page /CSS seems to be disappeared.Have you ever come across this problem ? Here is the solution to get rid of the probelm .

Instead of simply writing Response.Write, Use ” Page.ClientScript.RegisterStartupScript”

Ex : string strRenderImg=@”<img src=’company_logo1.gif’ align=’center’ />”;

Page.ClientScript.RegisterStartupScript(this.GetType(), “strRenderImg”, strRenderImg);