Wednesday, March 21, 2012

Partial Postback Does not Register Client Startup Script

When we do a full postback, the page's client script registers a startup script like the one below, however, on a partial postback the script is not registered. Since the script is not registered, our calendars fail to initialize and are not usable. Any help would be appreciated. Thanks!

string StartCalendarJS ="var calStart0 = new js_calendar(document.getElementById('" + StartDateTextBox.ClientID +"'));";

StartCalendarJS +=

"calStart0.year_scroll = true;";

StartCalendarJS +=

"calStart0.time_comp = false;";

cs.RegisterStartupScript(cs.GetType(),

"CsStartDate", StartCalendarJS,true);

StartDateCal.Attributes.Add(

"onclick","javascript:calStart0.popup();");

StartDateCal.Attributes.Add(

"onMouseOver","this.style.cursor='hand';");I would also like to share that the code above is being executed during the DataBound function of a gridview which includes the calendar we are trying to implement. Thanks.

Try,

System.Web.UI.ScriptManager.RegisterClientScriptBlock(.........);

Aeries


That also does not execute the js.

Any answer to this yet? Perhaps this is fixed in the latest version? We are using the Nov. 2006 release.

Any information would be great.

Thanks

No comments:

Post a Comment