asp.net-mvc-2

How to get TryUpdateModel to update a child object also in Asp.net MVC2

I have an object (Object1), which contains a child object (Child). Thus, you would access the child by Object1.Child. In my ASP.NET MVC2 project, I a receiving the POST reply to the create method. The FormCollection contains properties for both the Object1 and Child objects. I cannot seem to get the child object to be updated with th...

ASP.NET Request Validation Exception Even When Validation Is Disabled

...

dataTable.net Server-Side Processing: Not seeming to refresh.

For the site my coworkers and I are working on, we used the dataTable format from www.dataTables.net and we have to use Server-Side processing because of how much the tables grow. Here's the view: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <script type="text/javascript" charset="utf-8"> $(document).ready(f...

Where can I find some good online resources on asp.net mvc 2

I want to learn the new features in asp.net mvc 2. Where online can I learn all the features of asp.net mvc 2 ...

Cannot access static resources Asp.Net Mvc 2 on IIS 7. when configured a Virtual Host

Cannot access static resources Asp.Net Mvc 2 on IIS 7. when configured a Virtual Host. I've set the following: In hosts.etc I've written the following "127.0.0.1 localhost blueprint" I've create in IIS 7 set the directory root to where the MVC 2 application is located and set the domain host name to blueprint over http and port 80. ...

File uploader in asp.net mvc

How can identify input (type="file") id of fileupload while file uploading to server. Let me explain in detail: I have multiple file upload control on my page and different control save file on different folders like "Fileupload1" will save file on "Folder1" and so on. ...

Determine which portal to route to in a multi-tenant MVC website

Hello, I am working on a simple MVC2 multi-tenant application. My question is how do I determine which tenant portal has been asked for in the url by the user? What I need to have happen is this: A request to http://localhost should go to the standard Home controller’s index page A request to http://localhost/client1 should go to the ...

MVC2 Partial View throws/catches exceptions while resolving the path to the view

While debugging my Visual Studio 2010 MVC2 solution, I noticed something that I didn't necessarily expect and that struck me as inefficient. When I was viewing the Home page, the IntelliTrace showed that many exceptions were getting thrown and caught while resolving a partial view. I have code that calls the partial view like this: <%...

Can I create a web service that streams a pdf for download

I don't have much experience with web services, but I think I have a problem for which a web service would work great. My company has just purchased a .net version of Cete Pdf Merger (great product btw). We use both .Net & asp code and will likely use java in the future as well. The scenario is that one technology (asp, java, .net) wou...

Help with Ninject in asp.net mvc 2

Im trying to add Ninject to my app so that (maybe) I can try creating/running tests in it... so I need a little help setting this up here's my controller public class CompaniesController : Controller { private ICompaniesServices _service; public CompaniesController() { ...

how to get the string from dropdown list ..

Hello friends, I have this code in my controller for Index view.. public ActionResult Index(int? id) { _viewModel.ServiceTypeListAll = new SelectList(_bvRepository.GetAllServiceTypes().ToList().OrderBy(n => n.ServiceTypeName).ToList(), "ServiceTypeId", "ServiceTypeName"); return View(_viewModel); ...

How to show dropdownlist value on edit

Hello Friends, this is my Question extension to this Question.. Here I am able to add the Dropdown list value to the Grid.. perfectly.. Ex: in my Dropdownlist box I have A B C D items.. When I add any Item I am displaying the grid and I am reloading my page. My grid have two columns one is added Dropdownlist value.. other is some ...

Limiting Access to "Functional Modules" in ASP.NET MVC

I am building a site in ASP.NET 4 and MVC2 that will have premium features, such as SMS notifications that will only be available to paid subscribers. I also have additional modules for things like Inventory, and Transactions etc I am already leveraging the standard MembershipProvider, and am leaning towards using Roles tp provide this ...

why can't the datacontext detect changes to controls binded to a dataview when these changes are done via js?

I created a javascript AdoNetDataContext and created a DataView from it. I was using textboxes on the template for the table columns. AdoNetDataContext can track changes if there were any on the textboxes corresponding to the table columns used. But my changes to the textbox are done via jquery. The thing is, datacontext does not recogni...

asp.net MVC: RescueAttribute (mvccontrib) vs HandleErrrorsAttribute?

Hi there, I recently came across the rescue attribute which is part of the mvccontrib project... At first glance it appeared to allow you to server up different error views depending on controller / actions etc.. But taking a closer look, it also appears that the standard HandleError attribute that ships with mvc also allows you to do ...

Upgrading to ASP.NET MVC 2 - formCollection.ToValueProvider()

I am getting the following error: Cannot implicitly convert type IValueProvider to IDictionary When I try to run the code below: IDictionary<string, ValueProviderResult> valueProvider = formValues.ToValueProvider(); foreach (string k in formValues.Keys) { ModelState.SetModelValue(k, valueProvider[k]); } Can anyone help? ...

How to execute an SQL string directly in ASP.NET MVC 2 ?

ASP.NET MVC 2 + SQL Server Express... ...

Cusomize ASP.NET MVC Template

I have build a few ASP.NET MVC sites now and I find I am always adding some of the same files to each project. Specifically I use blueprint.org CSS files, I have some html helpers, email files. All sites have a contact us page. What I want to do is create a custom default asp.net mvc project so that these common files are included in all...

Resize image while preserving mimetype using .Net

Hi. I am loading images from a database and want to dynamically resize them according to some input. Code is something like this: public ActionResult GetImage(string imageID, int? width, int? height, bool constrain) { ValidateImageInput(width, height, constrain); ImageWithMimeType info = LoadFromDatabase(imageID); ...

open view in New Window From Controller Code not From Link or Button

How Can I Return or open a view in new window browser from only controller code when some validation a true But Not from Links and button code it should open automatically modelstate if is valid. Thanks... ...