asp.net-mvc

Entity Framework: Name Collisions (.NET MVC)

Hi, extremely sorry for writing here, I'm a php guy, been doing .NET MVC for like three days, although I had experience with C# some time ago. Anyways, I'm doing a simple website with shops and news stories. A news story could be either a global one, or tied to some shop. I use ShopId in the News table which can be 0. What I'm trying to...

MVC Reporting - a generic View which will display headers and results irrespective of number of columns in Model

Hi, for any new report requirement - 1] We will copy existing page, change sql, add authorisation and Done. This activity doesn't take more than half an hour. 2] or add IF else block in the existing page. However in MVC world, I have Controller Action - which will return model to view. And in View - Result and Headers will be disp...

Copying Models Between Layers

When traversing layers it is very tedious to perform right->left assignments as a way to populate the models. For example: employeeViewModel.FirstName = employeeModel.FirstName; employeeViewModel.LastName = employeeModel.LastName; ... So, we can build a ModelCopier which uses reflection to copy models: var employeeViewModel = ModelC...

Does Asp.Net MVC automatically loads the HttpGet Action result on session timeout

I have an asp.net mvc register view. This is the first page. If someone sits on it long enough for the session to expire, then start entering data and submit the form, it is automatically going into my HttpGet Action Result for register. Is this default behavior? Can it be changed so the user does not get a session timeout on the first...

How to pass information from controller to viewdata? asp net mvc c#

I am building a pagination my mvc project and have follew problem. I did everything for pagination and now need just pass a page information to view data in view. I have a user control Pagination: Pagination.ascx: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Pagination.ascx.cs" Inherits="PIMP.Web.TestForum....

Passing a date with JSON to .NET

Here is my jQuery code: function onSaveClicked() { var message = { MessageID: $("#MessageID").val() || 0, MessageDate: "\/Date(<%= DateTime.Now.Ticks %>)\/", }; $.ajax({ url: "<%= Url.Action("SaveMessage") %>", type: "POST", dataType: "json", data: $.toJSON(message), ...

ASP.NET MVC3 version release

Currently I am using ASP.NET MVC 3 version with Razor View Engine. Sometimes it is difficult to work with the ".cshtml" files without having intellisense. Do you have any information as to the release date of original version that supports intellisense? ...

Is asp.net mvc 1.0 radically different from asp.net mvc 2.0?

If I get a book on asp.net mvc 1.0 is it going to be helpful in learning 2.0? Or is it a waste of money? Thanks. edit: the problem with the books i have read review(s) on are that asp.net mvc encompasses a lot of other techonologies and the book just can't cover everything. I am thinking the safari online books could be good for tha...

converting a date from SQL Server to C# and then to javascript gives different results on US vs. London webserver

I have an asp.net mvc calendar application (using jquery ui datepicker) and i am running into a weird situation where when i test on a US webserver i see a certain date and when i test on a London web server i see a different date (the date before) Here are the details: I am storing a date in sql server as: 2010-09-16 00:00:00.000 ...

adding a wait page when first loading asp.net mvc

Hi All, What's the best way to add a loading page/splash page when a user first comes to my asp.net mvc application. Is there a way to add it so I want have to change the way it is accessed? What are some different ways to do this? Thanks, rod. ...

Custom Validation Attribute is not called ASP.NET MVC

Hello everyone I have create custom validation attribute and assign it to class level validation. Unfortunately, it is not called. I try every way that it think it could be solve the problem. However, it take me for hours and I can't find the attribute is not called by validation mechanism. For illustrate you I put the following code....

is it possible to define an area in MVC that will also act as a Controller with AreaViewEngine from s#arp architecture

hi every one! i would like to do this in my MVC application: localhost/Enterprises localhost/Enterprises/Create localhost/Enterprises/Details/1 localhost/Enterprises/1/Publications localhost/Enterprises/1/Publications/Create localhost/Enterprises/1/Publications/Details/1 With this, i can read that i would like to Create a Publicatio...

Default.aspx page in asp.net mvc

Hi All, What is the Default.aspx page for in mvc app? Does this actually execute? Does this page have anything to do with the "Default" route in the global.asax? Thanks, rod. ...

How would I open an MVC View in a new browser window

I have an ASP.Net MVC application. I would like to create a view that lists the contents of a simple collection and show it in a new browser window. Is there a way to show a view in a new browser window using a simple link? I have struck out with Html.ActionLink. The Url.Action below does result in the Controller action being called b...

ASP.NET MVC passing Data from Controller Action to a second controller for output

So basically I have a form with browser filters for data I'm displaying. I was hoping I could simply perform a post to my "SearchPost" controller, which handles all of the incoming filters and then spits out a Jquery grid for output, but unfortunately I haven't been able to find a free Jquery grid view that works. That said, I'm still ...

Controller method: passing values via POST vs. signature

//method declaration [AcceptVerbs(HttpVerbs.Post)] public ActionResult Step2_UpdateCart(bool? isNextStepClicked) //one of many of the view's fields processed by the method <input type="hidden" name="isNextStepClicked" value="false" /> I'm reverse engineering a View/Controller set where a form within the view has a series of inputs tha...

Resource addressing in MVC applications

I am working on an MVC site that contains overloaded controllers that accept variable parameters. Depending on the parameter count (mysite/{id}) versus (mysite/{id}/{name}/{state}) the relative paths to resources change. The same view may be used by different controllers. How do I best address resources such as script libraries or image...

How can I add an AddToFavorites link to a details page in ASP.NET MVC?

I have a details view with a sidebar and I would like to allow the user to add the current details to their favorites. I'm current using the following javascript, but I don't know how to pass the details id to the javascript to generate the link to be added to the users favorites. My javascript - This doesn't work of course... <script ...

View counter ASP.NET MVC

I'm going to create a view counter for articles. I have some questions: Should I ignore article's author when he opens the article? I don't want to update database each time. I can store in a Dictionary<int, int> (articleId, viewCount) how many times each article was viewed. After 100 hits I can update the database. I should only coun...

enterprise library VAB Implementation issues

Hi All.. I have an issue with the implementation of VAB. We are using ASP.NET MVC 1.0 I have a property "First Name" and we want to have 2 validations. Not Null Validator RegEx Validator (to stop some characters) Now if I leave it blank then it gives me the error message from both the validator. If the First name is blank I only w...