TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Blumonde
NA
78
28.7k
How can I access html elements in MVC
Nov 21 2017 8:12 PM
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.
Reply
Answers (
2
)
jQuery-Plugin-For-Automatic-Background-Slideshow-with-Image-
No 'Access-Control-Allow-Origin' header ajax call