943,616 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 610
  • ASP.NET RSS
Mar 10th, 2009
0

Response.Write Enlarges Text

Expand Post »
I am doing a response.write to write javascript to the page from the code behind. What I dont understand is why it is enlarging my text in the Table Headers?

Has anyone had this problem before? Or know what to do?
Last edited by firebirds98; Mar 10th, 2009 at 3:18 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
firebirds98 is offline Offline
15 posts
since Feb 2008
Mar 11th, 2009
0

Re: Response.Write Enlarges Text

Rather than using Response.Write to inject javascript from code behind, you can use the ClientScript.RegisterStartupScript function to achieve this. This may solve your issue. Here is a sample code

ASP.NET Syntax (Toggle Plain Text)
  1. string jsScript = @"<script language='javascript'>alert('This is my JS Statement');</script>";
  2. ClientScript.RegisterStartupScript(GetType(),"_script",jsScript );
Last edited by Aneesh_Argent; Mar 11th, 2009 at 3:06 am.
Reputation Points: 16
Solved Threads: 18
Junior Poster
Aneesh_Argent is offline Offline
104 posts
since Dec 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: got the asp.net membership/login blues.
Next Thread in ASP.NET Forum Timeline: problem in crystal report





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC