Click here to Skip to main content
11,629,285 members (67,044 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
how to write javascript code in aspx.cs using asp.net...?
Please Help

Thanks
Posted 18-Oct-11 20:57pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I think you need these functions : RegisterClientScriptBlock and RegisterStartupScript

read more at :
http://msdn.microsoft.com/en-us/library/aa478975.aspx[^]
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

You can call any javascript function by this :-

ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "whatever", "ShowGridViewColumn();", true);

or you can write it here also like this :-

ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "whatever", "alert('Hello');", true);
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


Advertise | Privacy | Mobile
Web02 | 2.8.150723.1 | Last Updated 20 Oct 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100