Dynamic controls in ASP.NET

I created a Windows Forms application in C # that allows users to add controls to TabPage that they can modify and modify. Now I want to do the same only in ASP.NET.

I managed to add controls dynamically after this tutorial . I use jQuery UI to make them resizable and draggable. The problem I am facing is that when I add a new control, everyone else returns to its original position and size.

I assume that I need to save their position and size and apply them to the newly created control on LoadViewState. Is there a way to view these attributes from code? I managed to get this information using Javascript, but I don’t know how to convert it to code.

Can anyone point me in the right direction? Thanks in advance.

[EDIT] Thanks for the reply. Here's the code: HTML C #

+3
source share
1 answer

You need to save the positions and sizes of the controls and transfer these values ​​to the server when you click the add button.

You have several options for how to do this.

  • Query string
  • Hidden forms ( <input type="hidden">)
  • Hidden text block (hidden from style="display: none;")

JavaScript , .

+2

All Articles