Hello,
Below is an example that was done through Asp.net code-behind. Does anyone know how we can accomplish the same task using MVC controller? Here is the link in case you are interested: https://www.mikesdotnetting.com/article/101/persisting-the-position-of-jquery-draggables-in-asp-net
- public partial class PersistDraggable : Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- Coordinates coords = new Coordinates();
- DataTable dt = coords.GetSavedCoords(1);
- foreach (DataRow row in dt.Rows)
- {
- HtmlControl ctl = (HtmlControl)this.FindControl(row["element"].ToString());
- if (ctl != null)
- {
- ctl.Style.Add("left", row["xPos"].ToString() + "px");
- ctl.Style.Add("top", row["yPos"].ToString() + "px");
- }
- }
- }
- }
Thank you for reading this post.