asp.net-mvc

ASP.NET MVC Data passing

Hi, I need a good example or guideline which could give me a pattern for data passing between view and partial view. For example I have a view which contains several partial views. I refresh these partial view by ajax. So I need to pass data among view and its partial views. The best way would be if I could pass data without using Tem...

asp.net mvc insert doesnt seem to work for me....

My controller's call to repository insert method all the values are passed but it doesn't get inserted in my table.. My controller method, [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create([Bind(Exclude = "Id")]FormCollection collection) { try { MaterialsObj materialsObj = ...

ASP.NET MVC search route

I setup a search route: routes.MapRoute( "Search", "Search/{q}", new { controller = "Search", action = "Index" } ); The search form has an input box and a button. I want the search with a GET as below. <% using(Html.BeginForm("Index", "Search", FormMethod.Get)) {%> <%:Html.TextBox("q")%> <span class="query-button"> ...

asp.net mvc form add comment

I have a page where a product appears on the right side and the user can add comment so i have a user control which gets all the comments and a small text area where user can add new comment for that product. the link of the page is like http://localhost/Product/TestComment/1 Where 1 indicates the id of the product and I have been ...

How can I combine two fields in a SelectList text description?

I want put in a selected list labels the name and surname of people of an EF model. I've tried with this: public ActionResult Insert() { ViewData["accountlist"] = new SelectList(time.Anagrafica_Dipendente.ToList(), "ID_Dipendente", "Surname Name", null); Giustificativi g = new Giustificativi(...

Is AsParallel() good practice in a web environment?

I have no doubt that for client applications, AsParallel() will bring some out-of-the-box performance gains. But what if I would use it in a web environment. Let's say I have a widget framework that loops over all widgets to get their data and render output. This would parallelize great no? I do have my doubts on using AsParallel() in t...

Images not shown when publishing MVC application to virtual directory inside default web-site

Hi! I am developing an application using ASP.NET MVC 1 and VS2008. When I deploy it to the default web-site in my IIS6 on WinXP, all images are shown correctly, path to any given image is localhost/Content/ImagesUI/[image].[ext] When I deploy it to the virtual directory, created inside the same site, any image request returns IIS stand...

Can I pass data via jQuery to ASP.NET MVC controller action and have a view rendered in new browser tab

Hi, Can anyone advise if its possible to pass data via jQuery to an ASP.NET MVC controller action and have a view rendered in a new browser tab based on the model data passed to the action method. My scenario is that I have a jQGrid populated with product info on a page. The user would tick the items in the grid that they would like a ...

Define Default constructor Structuremap in a Generic Repository

Hello guys, I have a generic IRepository that has 2 constructors, one have none parameters, other has the datacontext as parameter. I want to define to structuremap to aways in this case use the parameterless constructor. I want a way to create a parameterless contructor, other solutions that I have seen, they create a new Datacontext a...

Retrieve checkbox values in viewmodel

This question has been asked many times but none that I really understand. I have a checkbox list in a generated table. I want to submit the form and retrieve the checkbox values and capture the checked boxes. In the view: <% foreach (var item in Model.Results) { %> <%= Html.CheckBox("select...

MvcContrib Test Helper problem

I am using MVC2 with MvcContrib HelpTester. I have problem with testing Controllers which are in Areas. Here is my Test class : [TestFixture] public class RouteTests { [TestFixtureSetUp] public void Setup() { RouteTable.Routes.Clear(); MvcApplication.RegisterRoutes(RouteTable.R...

Html.CheckBoxFor() checked problem in ASP.Net MVC 2

It doesn't seem that the Html.CheckBoxFor helper adds the correct "checked" attribute when rendering the HTML. I have a bool property rendered like so: <%= Html.CheckBoxFor(m => m.Visible) %> And the outputted HTML is this: <input type="checkbox" value="true" name="Visible" id="Visible"> Is there some particular reason it does not...

Increasing Max Upload File Size on IIS7/Win7 Pro

I'm setting up a server for a client (something I don't typically do), and I'm running into issues with uploading larger files (11MB). The server is running Windows 7 Professional with IIS added. In web.config I've tried setting <system.web> <httpRuntime maxRequestLength="65536" /> <!-- 64MB --> </system.web> ... and that doesn't...

Filter list, order, edit row and return

Here's the situation : You have a list of items. The list can be paged, filtered and ordered. On every row, an edit button. Click the edit button, go to a page and save. Now - I would like to go back to the same filters/page as before. I would also like to make this as generic as possible so it's easy to apply on multiple pages. Her...

Order attribute in ASP.net MVC data annotations

I am trying to use <%=Html.EditorForModel() %> is there any way to specify the display order of the properties through DataAnnotations ...

asp.net mvc - reusing pages/controllers in workflow

I have 2 workflows: 1) the user signs up for the first time. They see 3 different screens, their basic user information, their credit card, and some additional profile information. They complete these 3 steps in a wizard like fashion, where each time they hit "submit" they leave the current screen and move on to the next. 2) the user...

ASP.NET MVC two user control

I have two user controls on the page and one of the user control has this text aread. which is used to add a note and but when they click add note button the page reloads. I do not want the page to reload ,i was looking for an example which this is done without postback. Thanks i tired doing this using JSON , but it throws the followin...

Extending fluent nhibernate mappings in another assembly

Hi, I'm using NHibernate with my ASP.Net MVC application. I'm writing some extensions (plugins) for my application. And I'm loading those plugin dynamically (from different assemblies). In my base application I have many entities and mappings defined (User, Group, etc...) I need to create new entities in my extensions, so i.e. I'm crea...

Dynamic Forms and AntiForgeryToken MVC

I want to create dynamic forms on a MVC page that will generate something like this. onclick=" var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href; var s = document.createElement('input'); s.setAttribute('type', 'hidden...

Test run errors with MSTest in VS2010

When I run my Unit Tests, all tests pass, but instead of "Test run succeeded" or whatever the success message is, I get "Test run error" in the little bar that tells me how many of my tests pass, even though all my tests passed. When i click the text, I'm taken to a page that tells me the following two things happened: Warning: conf...