asp.net-mvc

Display an overlay while generating/returning a file from a controller

Hi all, I'm currently generating and returning a fairly large file from a controller on a button click from a view. What i'd like to be able to do is display an overlay stating "Generating File" while the file is being generated and once it's done have the overlay disappear. How would i go about doing something like this? Here's a samp...

ASP.Net MVC - Viewstate validation failed on page with no viewstate (or server side controls)

An interesting take on an error that's really fustrating. I have a MVC page with no runat=server controls, a single form, and yet I have still recieved a "Validation of viewstate MAC failed" exception on the page, when reading through my error logs. Here is the exception thrown: System.Web.HttpException: Validation of viewstate MAC fa...

Object reference not set error INSIDE != null only if block?

Repository code: public IQueryable<Bundle> getAllCustomBundlesByCompanyID(int companyID) { return from companyBundle in db.CompanyBundles join bundle in db.Bundles on companyBundle.BundleID equals bundle.BundleID where companyBundle.CompanyID == companyID && bundle.CompanyID == companyID orderby bund...

Persist data using JSON

I'm tryping to use JSON to update records in a database without a postback and I'm having trouble implementing it. This is my first time doing this so I would appreciate being pointed in the right direction. (Explanation, irrelevant to my question: I am displaying a list of items that are sortable using a jquery plugin. The text o...

ASP.NET MVC ViewModel mapping with custom formatting

The project I'm working on has a large number of currency properties in the domain model and I'm needing for format these as $#,###.## for transmitting to and from the view. I've had a view thoughts as to different approaches which could be used. One approach could be to format the values explicitly inside the view, as in "Pattern 1" f...

Send complex JavaScript object to ASP.Net MVC Action

This seems to be quite a common theme and a few people have given some very constructive answers, but I'm still struggling to get my attempt to work. The problem is much the same as this one for example, except that I'm only trying to send a single complex object instead of an array. My controller looks like this: [AcceptVerbs (HttpVe...

Am I using ThreadPool.QueueUserWorkItem properly?

I am working on a ASP.NET MVC app. I wanted to spawn few threads when a event occurs, I dont care for the return value of my threads and I wanted to make a async call so I am using ThreadPool.QueueUserWorkItem , public event SomeEventHandler SomeEvent; private void SomeEventhappened(UserProfile arg) { SomeEventHan...

What SQL Server (Express) logins are needed for an ASP.NET MVC site?

For ASP.NET webforms, I have always needed the following server login: [machine_name\ASPNET]. Questions Is this requirement the same for ASP.NET MVC? If not, what do I need? Does it matter what version of SQL Server I'm using? (Currently, I'm running SQL Server Express 2005, but this could change in the future.) Does it matter what ve...

ControllerFactory Help please

I recently followed Stephen Walther through creating a generic repository for your data models using the Entity Framework with the following link, http://bit.ly/7BoMjT In this blog he briefly talks about creating a generic repository and why it's suggested to do so (to be clear of friction). The blog itself doesn't go into great detail...

pagination problem on iis server v5.1 using asp.net mvc framework

Hi, i am new to this mvc framework in asp.net. My problem is I have implemented pagination in my application and its working fine asp.net development server when i click to the page link on addressbar it shows me http://localhost:1139/eigencrm/AdminUsers?page=2 and display the lists on second page. In the AdminUsers Controller i have def...

Seek overview of the '=>' operator

I'm browsing sample asp.net code in an MVC project and need a better understanding of the => operator. Plugging => into search engines is non-helpful. thx ...

Downside to Forever Timeout in ASP.NET MVC?

As a user, when I see a "remember me" checkbox, I expect it to remember me -- not just when I close my browser, but when I come back to the site after a week. So in my ASP.NET MVC application I am considering the following web.config values: <authentication mode="Forms"> <forms defaultUrl="/" loginUrl="/account/login" name=".ASPXAU...

Can we use ASP.NET Web Server controls in ASP.NET MVC using the Spark View Engine?

I am trying to develop an application using ASP.NET MVC 2 with Spark as View Engine for the Imagine Cup. To win the IE8 award, I must use some features of IE8. I saw that there are some server controls (Web Slice Control, Accelerator Control, Visual Search Control, Browser Helper Control at http://code.msdn.microsoft.com/WebAppToolkitIE8...

Can't add ModelBinder attribute to a property of input model

I want to specify the model binder to use for a property of my input model. public class SendEmailInput { [Required, EmailAddress] public string From { get; set; } [Required] public string To { get; set; } [Required] public string Subject { get; set; } [Required, ModelBinder(typeof(RadEditorModelBinder))] ...

Linq Query slow on host but not on dev machine

I'm running ASP.NET MVC 2 Preview 2 (With VS 2010 Beta 2) using Entity Framework. Earlier yesterday, for some unknown reason, a single page in my app started to load very slowly on my host. The problem is, this only occurs on my host and I haven't changed anything for it to load slow. Here is the action that is loading very slow: pub...

Possible to move an Absoulte position if another absoulte position is already on that spot?

Hi I am trying to make a calendar on my website. So in my C# code I make all the table cells for that calendar(I return it as a string of html into my View). While doing that I check my database to see if any tasks go in that cell and loop through it till no tasks are left. I then move on to the next cell and do the same thing again. H...

using a wildcard route, what to check for page number at the end

I have a wild card route, but at the same time I want to check for the existance of a page number at the end of the url. so my url might look like: www.example.com/category/parentcat/childcat/234 where 234 is the page number. the route currently looks like: new Route("category/{*category} Since its a wild card route, I can't put ...

ASP.NET MVC wants me to store my SQL Server database files in the App_Data folder -- should I?

When creating a new database with SQL Server Express 2005, the database files (.mdf and .ldf) get stored in C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data by default. However, with the tutorials I've seen for ASP.NET MVC (e.g., Nerd Dinner), it seems to be common practice to keep the database files in the ASP.NET project's App...

Is it possible to update the name of each checkbox in an html table using jquery

i have a html table where one of the columns is a set of checkboxes There are three checkboxes in each row. The original names of the checkboxes are Row 1: person[0].Choices (value=1 name= person[0].Choices value=2 person[0].Choices, etc. .) Row 2: person[1].Choices(value=1 name= person[1].Choices value=2 person[1].Choices, etc . ...

Html Helper Not Working on nested Site Master page

I'm sure I'm doing something really stupid, but I've created a Nested Site master for one section of my app. I got the extra text to show up, like it should on the new Site Master (Greek.Master). But when I went to add some Html to Greek.Master, I found out the html helper isn't working. Here's my nested master <%@ Master Language="C...