All Questions

0
votes
1answer
29 views

How to add two text boxes texts to html table with button click and increment rows dynamically?

I have a drop-down list, two textboxes, add button and a table. There are two things which I need to do. First thing is, fill one textbox with the drop-down list's selected text and the user will ...
1
vote
2answers
68 views

View and ViewModel best practice

I have doubts about should every view have his own ViewModel or i should pass plain model where there is no need for ViewModel (What concerns me is if i start to mix this two concepts i will end up ...
1
vote
1answer
32 views

Why my session value changed for a particular value?

Can someone help understand why my session value changed for a particular value, 03375? My MVC controller code: Session["something"] = "03375"; My view js code: $(function(){ alert(@Session["...
0
votes
1answer
104 views

Edit view - search form

I have some basic CRUD views for a model: public class Task { public Task() { this.Users = new List<ApplicationUser>(); } public string Id { get; set; } public string ...
0
votes
4answers
681 views

How do I pass multiple objects from a ViewModel to a jQuery function?

I am coding a MVC 5 internet application and would like to know how to pass values from a ViewModel into a jQuery function where I have a list of data to pass. Usually, I would create a hidden field ...
2
votes
2answers
1k views

MVC 5 ViewBag security

I am coding an MVC internet application, and I have a question in regards to using the ViewBag. In many of my controllers, I have SelectList objects, where the user can select an object. The object ...
1
vote
1answer
320 views

MVC 5 - Pass object to a shared view

I am developing a MVC 5 internet application and have a question in regards to passing an object to a shared view. I have a view called CustomError.cshtml in the shared folder. This view has the ...
0
votes
1answer
558 views

Sorting items in a list of MVC view without involvement of controller

Based on my understanding i found that we can code from the View also. So i have a list which is populated in View using foreach loop. @foreach (var item in Model) { @Html.Raw(item.Name)<br /> @...
4
votes
2answers
1k views

Having to repopulate viewmodel when modelstate is invalid due to not sending all data in such as drop down box list

In my project I create a survey, I link this survey to a company and select users to participate. I select survey template, add extra questions and sets information about the survey such as start and ...
0
votes
2answers
84 views

How can you do multiple saves of a model in one submit?

I have a model: public class CustomerAttributes { public Int Id { get; set; } public string value { get; set; } } my create view looks like this: <div class="editor-label"> ...
3
votes
1answer
926 views

MVC view rendering does not respect data passed in a view model

I am attempting to create an MVC action method that allows users to progressively review a sequence of database records. Each time a user posts an update, it is submitted to the database and a new ...