Home > ASP.NET, C# > CSS missing while using Response.Write in ASP.NET page

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

December 15th, 2009 Shyju Leave a comment Go to 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);

  1. No comments yet.
  1. No trackbacks yet.