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
vidhya
NA
324
88.2k
dynamic control disappears when i refresh or close the page
Jul 24 2013 4:57 AM
I need to add the control in the page at the run time. i have a code to add the control dynamically. but the control disappears when i refresh the page or close the page. i need to display the controls in the page itself when i refresh or close the page.
<script type="text/javascript">
$(document).ready(function()
{
$("#txt").click(function()
{
var $ctrl = $('<input/>').attr({ type: 'text', name:'text', value:'text'}).addClass("text");
$("#holder").append($ctrl);
});
}
</script>
@using (Html.BeginForm())
{
<div>
<fieldset>
<legend><span>2.</span> Statements & Responses</legend>
<input type="button" id="txt" value="Add TextBox" style="" />
<div id="holder">
</div>
</fieldset>
</div>
}
Reply
Answers (
22
)
user control as a server web control
Accessing master page div control