Encountering a dilemma:
I have developed a fully dynamic site with only one update panel on the startpage. All content is generated dynamically through code behind, with different pages as web user controls.
The issue arises when attempting to open two drag-able panels using the Ajax Control Toolkit. Despite wanting to position these panels using JavaScript, the positioning script fails to execute.
It is worth noting that I am still navigating within the first page of the website, hence there is no browser history. Upon inspecting the page source, it displays the code for the login page, which is the initial landing page of the site.
Avoiding any postbacks to prevent altering the page-history, how can I successfully run the required JavaScript for window positioning?
Resolved
Finding a solution, I addressed this challenge by shifting the positioning logic to the server side. I implemented a "Window Manager" to track all open windows on the site. Subsequently, I managed to set the position by including it in the Style attribute of my web user control as follows:
protected void Page_Init(object sender, EventArgs e)
{
PartPanel.Attributes.Add("Style", Position);
}
public string Position
{
get
{
return "position:absolute;left:" + PosX "px;top:" + PosY + "px;";
}
}