Search Results

Search found 567 results on 23 pages for 'mvc2'.

Page 5/23 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Setting up multiple areas in sharp MVC2 - SharpArchitecture 1.6

    - by Hamid
    Im using sharp architecture 1.6 framework to create a MVC2 app. I have two areas, "Business", "Content". Im using BusinessAreaRegistration.cs and ContentAreaRegistration.cs to register the areas by using AreaRegistration.RegisterAllAreas(). The Content area gets routed just fine, but the business area does not work at all. gooing to /business/businessObjects/ show the error Server Error in '/' Application. The resource cannot be found. How can I register both areas properly?

    Read the article

  • MVC2 Clientside Validation and duplicate ID's problem

    - by Dusty Roberts
    I'm using MVC2 with VS2010 I have a view that has two partial views in it: "Login" and "Register" both partial views contains the Email address field i use the following in both partial views: <%: Html.TextBoxFor(model => model.EmailAddress ) %><br /><%: Html.ValidationMessageFor(model => model.EmailAddress) %> if i use both partial views on one page, it ends up having duplicate id's so validation happens across both views (even thopugh they are in seperate forms) how can i go about eliminating this

    Read the article

  • Tailspin example keeps failing on ASP.NET MVC2 RC2

    - by Sven
    I wanted to look at the TailSpin example from PDC2009 but it keeps failing when it does the scan for ASP.NET MVC2 RC2. I'm sure it is installed; Have checked the assembly, System.Web.MVC and it's version 2.0.50129.0. That sould be OK. ASP.NET MVC tools for VS2010 is also installed. Can anyone help me out? How can I overwrite that check?

    Read the article

  • How to get the checked checkbox from a ASP.NET MVC2 form

    - by JF
    I have a hard time in asp.net MVC2 trying to get the checked values of different checkbox. Here is my view <div id="RoleSelection"> <ul> <% foreach (var roles in Model.Roles) { %> <li> <input type="checkbox" id="roles" value="<%: roles %>" /> <%: roles %> </li> <% } %> </ul> </div> My model: [LocalizedDisplayName("Role", NameResourceType = typeof(UserResources))] public string Role { get; set; } public IEnumerable<string> Roles { get; set; } So basically here I'm trying to figure out how to get all the checked checkbox from my form! Thank you

    Read the article

  • Custom Validation with MVC2 and EF4

    - by csharpnoob
    Hi, on ScottGu's Blog is an Example how to use MVC2 Custom Validation with EF4: http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx So here the Problem: When the Designer in VS2010 creates the Objects for the DB, along to the example you have to add [MetadataType(typeof(Person_validation))] Annotation to that class. But when i change anything in the Designer all these Annotations are lost. Is it possible to keep self made changes to the edmx file, or is there any better way of applying System.ComponentModel.DataAnnotations to the generated Entities? Thanks.

    Read the article

  • Error Running MVC2 application in IIS on .NET 4.0

    - by Matt Wrock
    I recently installed the RTM version of 4.0. I now receive an error when running MVC2 websites in a .net 4 app pool. The error is "User is not available in this context." All works fine on .net 2.0 app pools or if I run the app within the VS10 web server. The error only occurs in IIS on .net 4.0. To verify that it was not something specific to my app, I created a new MVC test app from the VS template and even that app encounters this error. My next step is to reinstall .net 4.0. Has anyone else seen this error?

    Read the article

  • ASP.NET MVC2 and AJAX

    - by Jason
    I am currently developing a new website utilizing ASP.NET MVC2. Much of what I want to do with the website (from a front-end standpoint) involves AJAX-y-type tasks. Two examples: I want to display forms, and switch between them via a drop-down menu (or through links) without having to go back and hit the server every single time. I want the user to be able to select points on a Chart Control and have portions of the page refresh with the appropriate data depending on what he/she selects (partial page refresh). In both these cases, I am able to accomplish what I wish to accomplish using the traditional web forms event handlers, etc. Unfortunately, the use of a ScriptManager violates the spirit of MVC. It seems as if MVC prevents the use of many of the controls that are available to ASP.NET. So, my question is: how do I use AJAX and make AJAX calls without utilizing ScriptManager and the web forms method of utilizing event handlers?

    Read the article

  • .Ajax with jQuery and MVC2

    - by Mario
    Im trying to create an ajax (post) event that will populate a table in a div on button click. I have a list of groups, when you click on a group, I would like the table to "disappear" and the members that belong to that group to "appear". My problem comes up when using jQuery's .ajax... When I click on the button, it is looking for a controller that doesnt exist, and a controller that is NOT referenced. I am, however, using AREAS (MVC2), and the area is named Member_Select where the controller is named MemberSelect. When I click on the button, I get a 404 stating it cannot find the controller Member_Select. I have examined the link button and it is set to Member_Select when clicked on, but here's the ajax call: $.ajax({ type: "POST", url: '/MemberSelect/GetMembersFromGroup', success: function(html) { $("#groupResults").html(html); } }); I havent been able to find any examples/help online. Any thoughts/suggestions/hints would be greatly appreciated. Thanks!

    Read the article

  • MVC2 jQuery Validation & Custom Business Objects

    - by durilai
    I have an application that was built with MVC1 and am in the process of updating to MVC2. I have a custom DLL and BLL, of which the model objects are custom business objects that reside in a separate class library. I was using this validation library in MVC1, which worked great. It worked great, but I want to eliminate the extra plugins and use what is available. Rather than use the Enterprise Library validation attributes I have converted to using DataAnnotations and want to use jQuery validation as the client side validation. My questions are: 1) Is the MicrosoftMvcJQueryValidation JS file still required, where do I download. 2) How to you automate the validation to views that do not have models, IE Membership sign in page? 3) How to you add model errors in a custom business layer. Thanks for any help or guidance.

    Read the article

  • MVC2 ValidationSummary and Client side Validation

    - by Raj Aththanayake
    Hi I want to have the ValidationSummary errors displayed during Client Side validation. Currently the validation messages are only appears next to the field during client side validation. I use…. MicrosoftAjax.js MicrosoftMvcAjax.js MicrosoftMvcValidation.js as my client side libraries. There is a solution for jQuery Validation Library which is in the thread… http://stackoverflow.com/questions/1724790/asp-net-mvc-validationsummary-for-client-side-validation Is there an easy way to do this? I used had xVal working DataAnnotation and it was very easy enable client side validation for the validation summary. E.g <%= Html.ClientSideValidation().UseValidationSummary("validationSummary", “Validation Errors”)% Is there way to do this in MVC2 using MicrosoftAjax?

    Read the article

  • MVC2 Client-Side Validation for injected Ajax content

    - by radu-negrila
    Hi, I am making an Ajax call and adding content to a form inside a MVC2 app. I need to update the Client Validation Metadata with the validation for my new content. <script type="text/javascript"> //<![CDATA[ if (!window.mvcClientValidationMetadata) { window.mvcClientValidationMetadata = []; } window.mvcClientValidationMetadata.push({"Fields":[{" ... </script> Is there a way to generate this metadata for a partial view ? Thanks in advance.

    Read the article

  • Bind ISet in ASP.NET MVC2

    - by Dmitriy Nagirnyak
    Hi, I am trying to find out what would be the best bind first element of ISet (Iesi.Collection) as a first element. So basically I only have to use some kind of collection that has an indexer (and ISet doesn't) then I can write code like this (which works perfectly well): <%: Html.EditorFor(x => x.Company.PrimaryUsers[0].Email) %> But as the ISet has no indexer I cannot use it. So how can I then bind the first element of ISet in MVC2? Thanks, Dmitriy.

    Read the article

  • how to upload the fie from user to server in asp.net mvc2

    - by Richa Media and services
    in my apps (dev in MVC2) user can upload his images to server. how i can set url routing who handle the image and upload it to a specific location currently i used it like a parameter ex;- routes.MapRoute("abcd2", "abcd/{id}/{param1}/{param2}/", new { controller = "abcd", action = "Index", id = 0, qxt = "" }, new { action = new IsIndexConstraint() }, new string[] { "myapps.Controllers" }); by this code param2 is work i used param1 for sending file to server but he not worked public ActionResult Index(HttpPostedFileBase param1 , string param2) { string str = "null"; if (param1 != null) { param1.SaveAs(@"C:\img\" + param1.FileName); str = "func is work"; //picture.SaveAs("C:\wherever\" + picture.FileName); return Content(str); } else { str = "func is not worked"; } return Content(str); } are anyone really want to help me. param2 is work but param1 is not handle by web apps. are you suggest me how to do it.

    Read the article

  • Handling ID's with db4o and ASP.NET MVC2

    - by Craig McGuff
    So, i'm looking at the TekPub sample for ASP.NET MVC2 (http://mvcstarter.codeplex.com/) using DB4o and there are a bunch of templates to create controllers etc, the generated code looks like: public ActionResult Details(int id) { var item = _session.Single<Account>(x=>x.ID == id); return View(item); } Now, my understanding is that using DB4o or a simliar object database that ID's are not required, so how/what exactly do I pass to enable this kind of templated code to function? UPDATE: Both answers were useful, I have modifed the templates to use GUID as the ID. I will add any relevant code/notes here once I see how it works out.

    Read the article

  • Conditionally embed ASP.NET MVC2 Views as resources during build in Visual Studio 2010

    - by jslatts
    I have a ASP.NET MVC2 project in VS2010 that can be deployed in two modes: standalone or plugin. In standalone mode, the views should live outside the compiled assembly as .aspx files (the default setup). In plugin mode, the views are switched (currently by hand) to embedded resources and the entire assembly is dropped into a host project folder. Currently, this requires the developer to go through each view and switch it from Build Action: "Content" to "Embedded Resource" and vice versa. I would like to create a new solution configuration to automatically grab all .aspx files and build them as resources. This SO post seems like the solution, but I would prefer not to have to edit the .csproj every single time I add a new view to the project. Is there a way to use a wild cards or some other batch/global conditionally statement to change resources from content to embedded?

    Read the article

  • MVC2 html dropdownlist is invisible

    - by Deb
    I am just trying to populate a html.dropdown list using mvc2 in VS2008. But the control is not displayed at all. Here is my code public ActionResult Index() { ViewData["Time"] = DateTime.Now.ToString(); var mdl = new List<SelectListItem>(); mdl.Add(new SelectListItem { Value = "1", Text = "Module One" }); mdl.Add(new SelectListItem { Value = "2", Text = "Module Two" }); ViewData["moduleList"] = new SelectList(mdl,"Value", "Text"); return View("MainMenu"); } and here is the markup <div> <%Html.DropDownList("moduleList", (IEnumerable<SelectListItem>)ViewData["moduleList"]); %> </div> Where did i go wrong ?

    Read the article

  • Using ViewModels in ASP.NET MVC 2 - multiple forms

    - by Rob Ellis
    I couldn't find any documentation around using multiple forms in an ASP.NET MVC 2 ViewModel approach. i.e. In the built in application when you select New MVC2 web app, the register page uses a ViewPage which inherits like this:- Inherits="System.Web.Mvc.ViewPage" I wanted to use that approach on a page with multiple forms, but that RegisterModel only supported one form.

    Read the article

  • asp.net mvc checkbox hierarchy

    - by mazhar
    I want to create a checkboxes hierarchy like this in mvc2.How would I be able to achieve this in the most simplest manner. Administrator Manage User Add Edit Delete View Manage Feature Add Edit Delete View Moderator Manage User Add Edit Delete View Manage Feature Add Edit Delete View

    Read the article

  • Mocking HttpContext in .NET MVC2 using Moq

    - by Richard
    Hi, This was working in MVC 1, but has broken in MVC 2. I'm mocking the HttpContext so I can test routes. The code was originally taken from Steven Sanderson's book. I've tried mocking some extra properties as suggested in this comment but it hasn't fixed it. What am I missing? This is the start of my test code. routeData is null when this code completes. // Arange RouteCollection routeConfig = new RouteCollection(); MvcApplication.RegisterRoutes(routeConfig); var mockHttpContext = makeMockHttpContext(url); // Act RouteData routeData = routeConfig.GetRouteData(mockHttpContext.Object); This method creates my mock HttpContext: private static Mock<HttpContextBase> makeMockHttpContext(String url) { var mockHttpContext = new Mock<System.Web.HttpContextBase>(); // Mock the request var mockRequest = new Mock<HttpRequestBase>(); mockHttpContext.Setup(t => t.Request).Returns(mockRequest.Object); mockRequest.Setup(t => t.AppRelativeCurrentExecutionFilePath).Returns(url); // Tried adding these to fix in MVC2 (didn't work) mockRequest.Setup(r => r.HttpMethod).Returns("GET"); mockRequest.Setup(r => r.Headers).Returns(new NameValueCollection()); mockRequest.Setup(r => r.Form).Returns(new NameValueCollection()); mockRequest.Setup(r => r.QueryString).Returns(new NameValueCollection()); mockRequest.Setup(r => r.Files).Returns(new Mock<HttpFileCollectionBase>().Object); // Mock the response var mockResponse = new Mock<HttpResponseBase>(); mockHttpContext.Setup(t => t.Response).Returns(mockResponse.Object); mockResponse.Setup(t => t.ApplyAppPathModifier(It.IsAny<String>())).Returns<String>(t => t); return mockHttpContext; }

    Read the article

  • MVC2 DataAnnotations on ViewModel - ModelState.isValid Always Returns true

    - by ScottSEA
    I have an MVC2 Application that uses MVVM pattern. I am trying use Data Annotations to validate form input. In my ThingsController I have two methods: [HttpGet] public ActionResult Index() { return View(); } public ActionResult Details(ThingsViewModel tvm) { if (!ModelState.IsValid) return View(tvm); try { Query q = new Query(tvm.Query); ThingRepository repository = new ThingRepository(q); tvm.Airplanes = repository.All(); return View(tvm); } catch (Exception) { return View(); } } My Details.aspx view is strongly typed to the ThingsViewModel: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Config.Web.Models.ThingsViewModel>" %> The ViewModel is a class consisting of a IList of returned Thing objects and the Query string (which is submitted on the form) and has the Required data annotation: public class ThingsViewModel { public IList<Thing> Things{ get; set; } [Required(ErrorMessage="You must enter a query")] public string Query { get; set; } } When I run this, and click the submit button on the form without entering a value I get a YSOD with the following error: The model item passed into the dictionary is of type 'Config.Web.Models.ThingsViewModel', but this dictionary requires a model item of type System.Collections.Generic.IEnumerable`1[Config.Domain.Entities.Thing]'. How can I get Data Annotations to work with a ViewModel? I cannot see what I'm missing or where I'm going wrong - the VM was working just fine before I started mucking around with validation.

    Read the article

  • ASP.Net MVC2 DropDownListFor

    - by hermiod
    Hi all I am trying to learn MVC2, C# and Linq to Entities all in one project (yes, I am mad) and I am experiencing some problems with DropDownListFor and passing the SelectList to it. This is the code in my controller: public ActionResult Create() { var Methods = te.Methods.Select(a => a); List<SelectListItem> MethodList = new List<SelectListItem>(); foreach (Method me in Methods) { SelectListItem sli=new SelectListItem(); sli.Text = me.Description; sli.Value = me.method_id.ToString(); MethodList.Add(sli); } ViewData["MethodList"] = MethodList.AsEnumerable(); Talkback tb = new Talkback(); return View(tb); } and I am having troubles trying to get the DropDownListFor to take the MethodList in ViewData. When I try: <%:Html.DropDownListFor(model => model.method_id,new SelectList("MethodList","method_id","Description",Model.method_id)) %> It errors out with the following message DataBinding: 'System.Char' does not contain a property with the name 'method_id'. I know why this is, as it is taking MethodList as a string, but I can't figure out how to get it to take the SelectList. If I do the following with a normal DropDownList: <%: Html.DropDownList("MethodList") %> It is quite happy with this. Can anyone help?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >