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
Ramco Ramco
439
3.4k
544.7k
Default Value in Modal Popup
May 31 2021 12:32 PM
Hi
I want whem Add Modal Popup opens ISActive value by default should be Y & disabled.
**********************
public class Location
{
private string _isactive = "Y";
[Key]
[Display(Name = "Id")]
public string Id { get; set; }
[DataType(DataType.Text)]
[RegularExpression(@"^[a-zA-Z'.\s]{1,25}$", ErrorMessage = "Special Characters not allowed")]
[Required(ErrorMessage = "Please enter Location"), MaxLength(25)]
[Display(Name = "Description")]
public string Description { get; set; }
[Display(Name = "Active")]
public string IsActive
{
get { return _isactive; }
set { _isactive = value; }
}
}
******************************************
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Add New Location</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-3" for="Id">Location Id</label>
<div class="col-sm-2">
<input type="text" class="form-control form-control-sm" id="txtId" placeholder="Id">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="Description">Location Name</label>
<div class="col-sm-9">
<input type="text" class="form-control form-control-sm" id="txtDescription" placeholder="Description">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="IsActive">Active</label>
<div class="col-sm-2">
<input type="text" class="form-control form-control-sm" id="txtIsActive" placeholder="Active">
</div>
</div>
</div>
</div>
<div class="modal-footer">
@*<button type="button" class="btn btn-primary" id="btnAdd" onclick="return Add();"><span class="glyphicon glyphicon-ok"></span>Save</button>*@
<button type="button" class="btn btn-primary" id="btnAdd" onclick="return Add();">Save</button>
<button type="button" class="btn btn-primary" id="btnUpdate" style="display:none;" onclick="Update();">Update</button>
<button type="button" class="btn btn-warning" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
Thanks
Reply
Answers (
3
)
EmptyTable Message in Jquery DataTable
Pass complex object on Post Redirection without TempData in .Net Core.