Response.Write Enlarges Text

Reply

Join Date: Feb 2008
Posts: 13
Reputation: firebirds98 is an unknown quantity at this point 
Solved Threads: 0
firebirds98 firebirds98 is offline Offline
Newbie Poster

Response.Write Enlarges Text

 
0
  #1
Mar 10th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 104
Reputation: Aneesh_Argent is an unknown quantity at this point 
Solved Threads: 18
Aneesh_Argent Aneesh_Argent is offline Offline
Junior Poster

Re: Response.Write Enlarges Text

 
0
  #2
Mar 11th, 2009
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

  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.
Falling down is not defeat...
Defeat is when you refuse to getup...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum


Views: 478 | Replies: 1
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC