It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming ASP & ASP.NET Forum

Calling javascript on page load if !IsPostBack

Calling javascript on page load if !IsPostBack

Postby mellomel70 on Tue Aug 02, 2011 3:49 pm

Hi, I need to call on javascript on page load ONLY when the page loads for the first time. I've tried:

Code: Select all
string ScriptToCall = @"EnableCheckboxes(" + cblDetails.ClientID + ", false);";
ClientScript.RegisterStartupScript(this.GetType(), "addScript", ScriptToCall, true);


where EnableCheckboxes is a javascript on the page, but it doesn't work.

[code]ClientScript.RegisterStartupScript(this.GetType(), "addScript", "alert('" + ScriptToCall + "');", true);[\code]

does work, so I think I'm on the right track, but ????

Anyone know?

Thanks!
mellomel70
 
Posts: 3
Joined: Tue Aug 02, 2011 2:50 pm

Who is online

Users browsing this forum: No registered users and 1 guest