Tag Info

New answers tagged

10

It seems perfectly reasonable to use an @if statement or two in a Razor view. They added @if to Razor - it's meant to be used. Your code could be shortened to one @if: @if (editing) { // some more fields shown in edit mode } else { // some stuff shown in create mode } An alternative is to use three views: Partial view containing the common HTML ...


14

Presentation logic comprises the logic and calculations that are needed to present the business data in the right way for a particular view. For complex graphical views, this can be quite complex calculations (for example, calculating the size of each pie slice and the positioning of the labels for a pie chart), but the main characteristic is that it only ...


1

Here is how you can accomplish this. I am going to explain a way in which you can utilize existed Asp.Net Mvc Accounts Tables even plus you can add further into them as well as per your requirements. First you need to install following Packages. Install-Package Microsoft.AspNet.Identity Install-Package Microsoft.AspNet.Identity.EntityFramework Now you ...


1

If I'm reading your question correctly, then what you're looking for is SimpleMembership. Here's an explanation of SimpleMembership; from the section Easy to with[sic] Entity Framework Code First: SimpleMembership ... allows[changed] you to use any table as a user store. That means you're in control of the user profile information, and you can access it ...


1

REST isn't carved in stone and this many-to-many relationship of nested resources is a very common problem with mostly two possible approaches. Which of the two is best for your specific case would depend on a few details and maybe how exactly asp.net handles things. But I will just describe both and explain why I mostly prefer the second approach. Approach ...


1

Here, use one of these (ViewBag, ViewData, etc): http://forums.asp.net/t/1893283.aspx?What+is+ViewData+and+ViewBag+in+ASP+Net+MVC4+and+what+is+use+and+with+examle+ If you can't stick with the pattern at least work within it...


1

Your basically asking what the implications of breaking the MVC pattern are. You can write an application in anyway you want. However, the advantage of using a pattern like MVC is that it is widely known. Any programmer who understands MVC can look at your application and say "Yes, I understand how the data flows throughout your application and I can add ...



Top 50 recent answers are included