Sunday, March 11, 2012

How Can I change the properties of Ajax progress bar at run time programatically!

You can only access the ProgressTemplate of the UpdateProgress control very late in the page's lifecycle. Trying to access it from Page_Load, Page_Init, or Page_PreRender will result in an error. Access it from the Page_PagePreRenderComplete event.

VB.NET:

Protected Sub Page_PreRenderComplete(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Me.PreRenderCompleteCType(UpdateProgress1.FindControl("PgbDataGrid"), UserControl).Attributes.Add("style","top:200px; left:200px;")End Sub

or Client-side/Javascript:

var uc = document.getElementById('<%= PgbDataGrid.ClientID %>');
uc.style.top = '200px';uc.style.left = '200px';

No comments:

Post a Comment