I have javascript which sets the location of panel and javascript is below
function ShowProgressPanel(progresspanel)
{
var progressPanelId = document.getElementById(progressPanel.ID);
alert(progressPanelId);
if (progressPanelId != null)
{
var height = Math.min(document.documentElement.clientHeight, document.body.offsetHeight);
alert(height);
var width = Math.min(document.documentElement.clientWidth, document.body.offsetWidth);
var xPos = Math.round((width / 2) - (progressPanelId.clientWidth / 2));
var yPos = Math.round((height / 2) - (progressPanelId.clientHeight / 2));
setLocation(progressPanelId, { x: xPos, y: yPos });
}
function setLocation(element, point)
{
Sys.UI.DomElement.setLocation(element, point.x, point.y);
}
}
I am passing client id from aspx page
var progressPanel = document.getElementById('<%=_progressPanel.ClientID %>');
ShowProgressPanel(progressPanel);
it is set to html div tag.above code works fine.when i send through aspx.cs page it shows contentplace holder element and height is not set.
string script = string.Format(@"ShowProgressPanel('{0}');", _progressPanel.ClientID);
ScriptManager.RegisterStartupScript(this, typeof(Page), _progressPanel.ID, script, true);
But in both progress panel is placed in contetnplaceholder.
How shall i do it in aspx.cs page
You are mixing the element and the id up.