Questions for asp.net-mvc-4


6271

Implement Repository Pattern in Asp.Net MVC with SOA architecture

We have starting new project in our company. We finalize the architecture as follows
7837

Entity Framework SQL Server increments an Id Key out of order if previous values are available

I have an MVC4 website and it has a SQL Server DB that contains its posts. On each post there is a Next and Previous button. These buttons are calculated from databaseContext.Post.Count() plus or m...
5583

.NET MVC4, Entity, Search

I have an MVC4 project using EF. I have set up my schema so that all searchable items have have a Table that relates them to a "Tags" table. I am wondering what is the most efficient way to do a full
6773

How to implement custom OpenID Relying Party in MVC 4

I like the new MVC OpenID/OAuth login feature, but I want to know how to add a new login button, for example I want my users to login using their StackExchange account or using their OpenID url the...
3996

Use TypeScript in ASP.NET MVC

How to effectively use TypeScript with ASP.NET MVC?
5625

MVC 4 jQuery modal dialog

Is there a way to get a jQuery modal dialog to be "truly" modal?
251

Update view's model or datatable for client updates?

In a web page, when a user deletes rows from a datatable, should I be using the view's model or the datatable to do the data manipulation? (I'm learning MVC 4, and I'm not sure if accessing the model
1703

How to Secure WebAPI with Single-Page

I'm building an application with an MVC4 single-page front end and a WebAPI on another machine that returns json query data directly to the browser. The authentication happens on the MVC side where a
8971

Why is my razor view complaining “} expected” after upgrade to razor 2 / mvc 4?

I have an existing razor 1 / mvc 3 view, with a few nested if - very simple, but after upgrading to razor 2 / mvc 4 it is complaining at runtime and compile (BuildViews) about } expected. It used t...
9034

Print inner text of a HtmlContent in a razor view (MVC4)

Using MVC, look at this example where we have the following HTML code:
3427

C# Linq To Excel Getting Table Data Not Starting In The First Row

I'm developing a MVC 4 web application and one of the requirements is to allow users to upload an excel file which is in a standard format and extract data and save that to a database. I have used ...
5318

How can I raise an http 404 from a FileStreamResult?

Normally I'd return HttpNotFound() but my method returns a FileStreamResult and I get
3529

Extending @Html.DropDownListFor

I would like to use the following code by extending the @Html.DropDownListFor helper.
5780

Visual indication of selected list item

I am very new to jQuery mobile and even newer to knockout.js. Now, I am to develop a website for mobile devices using asp.net mvc4 framework.
8870

Custom model error text in MVC 4

Background: I am extremely new to MVC, c#, and .net in general. I am working from the MVC4 internet application template in visual studio 2012.
9569

Clear text with JavaScript in MVC 4

I've the following search box:
6374

System.Data.SqlClient.SqlException: Invalid column name 'Email'

I'm working on a new ASP.Net MVC 4 app and testing user login. I am getting following exception:
2689

MVC Dynamic Form Fields

I have read this article which shows how to display dynamic fields via the use of editor templates http://coding-in.net/asp-net-mvc-3-how-to-use-editortemplates/
5973

How to force BundleCollection to flush cached script bundles in MVC4

... or how I learned to stop worrying and just write code against completely undocumented APIs from Microsoft. Is there any actual documentation of the official System.Web.Optimization release? 'cu...
4048

Oauth In Asp.net Webapi?

I am learning how to use the asp.net webapi. I want to make an admin area where I can do admin stuff but also add,edit,delete stuff into my database.
6327

how to get URL with two parameters in javascript?

i works in a MVC 4 project, and i have a small problem in my script, this is my script :
6087

how can I bind a complex class to a view, while preserving my custom validation attributes?

In my project I have a model class that uses another class, like in the sample below.
8089

Convert My MVC4 Web appication to android?

I have a web application developed on .NET Framework using MVC4. So now I need to create a Android Application for it. So as I have only 1 month experience in Android development. I need some help....
4769

Upgrading from Entity Framework 4 to 5 resulted in error

After upgrading to EF 5 I keep getting Validation failed for one or more entities. See 'EntityValidationErrors' property for more details' in a particular instance of my code.
6063

How i pass the data from windows popup to controller

I have create a popup windows called AddCust.cshtml. Once the user clicked btnSaveConsumer it should picked up all value entered. But i am not sure how to pass the controller. I tried to used the
5291

ASP.NET MVC Blog plugins?

I'm working on an ASP.NET MVC project.
172

Adding stored procedure in sql server compact, MVC4

I am new to asp.net mvc platform and wanted to try something out.
5398

Passing a list of objects to JavaScript from Controller method using Ajax

I have a controller method GetNearbyUsers which returns a list of users as a JsonResult. I am trying to call the method using the following ajax function:
8353

Client Side validation using jquery in MVC4

I am very new to ASP.NET 4 and MVC 4. I have a requirement of client-side validation using jQuery. Can some one please help me with a very basic code implementing of client side validation for exam...
9152

How to get a specific row from database in MVC 4

I have a model called PageModels
3985

Implementation of two legged OAuth 2.0 for WebApi

I created a mvc4 webapi project using VS2012RC. I tried to implement two legged Oauth 2 in my project. I followed the tutorial
5321

Want to Save Posted Json data to database

I am posting JSON data through AJAX POST as ::
5752

What is the string format to display the zeros (minimum 3 digits) after the decimal point in cshtml view page?

If the value is 3, then it should be display as 3.000, that is minimum to three decimals.
6329

How to clear browser cache on browser back button click in MVC4?

I know this is a popular question in stackoverflow. I have gone through every same question and I am unable to find the right answer for me.
4617
6105

How can be home controller define as root also when action have params? asp.mvc 4

By default if url is 'mydomain' it go to controller home; action = index.
3621

ASP.NET MVC 4 - Add Bundle from Controller?

I have some pages on my site that use certain CSS and JS resources - but they are the only page(s) to use that css or js file - so I don't want to include that CSS and JS reference in every page. R...
2590

Mvc4 having 2 forms in one view

So i'm building a simple mvc4 application, I have created all base models for the creation of the DB, from these classes I could naturally create basic controllers with their matching views.
2416

How do I inject an HTTP-Request-specific object into my Unity supplied object?

For example, I store the "current user" in Session. The business-layer object are being instantiated by Unity. How do I make the business-layer object aware of the "current user"?
2244

Why is MVC 4 Razor escaping ampersand when using HTML.Raw in a title attribute

We recently upgraded to MVC 4 and now we are having titles in our links not display correctly. The problem is before HTML.Raw would not escape & in our title attributes, but now it does. Below ...
1866

Rendering an html string to view

I have two controller actions that target the same view. That is, I have specified a view name on the call to View from controller action. The second action puts an html string in a ViewBag. I si...
2756

Nuget autoupdate in website

For a customer we are trying to build a webb application that they can build patches (new versions) and their customers can by them self by a click in the app update.
6155

Access Data from First recordset

I have a LINQ query that returns a few rows. It has a join so that it includes company contact information along with the detail records (so the contact info is repeated for every row). On my vie...
3934

Dynamically accessing properties of knockoutjs observable array

I am using the below code for handling sort functionality. It is working for me. But is there any way to make the code as common and so i can use it whenever needed.
8274

MVC4 Passing model from view to controller

I have a view with a model populated with data relating to booking a taxi.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.