Search Results

Search found 9394 results on 376 pages for 'mvc scaffolding'.

Page 48/376 | < Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >

  • ASP.NET MVC authentication for iPhone application

    - by manu08
    This is for an ASP.NET MVC application. For browser based access on my normal controllers, I'm using standard forms authentication and auth cookies. My question is how I do the same for an iPhone application. I have a set of RESTful controllers that the iPhone application uses directly, but I'm not sure how to go about authentication... I was thinking of having a special Login method that returns the auth cookie. Then I can use the standard Authentication attribute on the ASP.NET MVC side, but I'm not sure how to handle this on the iPhone side? Can I store this cookie and have it automatically sent with every request? Perhaps there's a better approach altogether?

    Read the article

  • appointments scheduler managment with asp.net MVC

    - by Alexandre Jobin
    I'm building an Appointments Scheduler manager on asp.net mvc. My requirements are: The administrator will add timeslot appointments to the calendar for each persons in the company who can receive a client The client can search online for available timeslot appointments and can make a reservation Idealy, the UI can show the appointsments by days/weeks or agenda style Is there any asp.net mvc control that can do this. Or any tutorials that can inspire me of how I can do this? For now, I've found the jQuery Week Calendar but I'm not sure it will answer all my needs and the author has stopped the development of the project. Thank you very much for the help!

    Read the article

  • ASP.NET MVC: ensure user always has a session variable set

    - by pcampbell
    Consider an ASP.NET MVC application that requires a session variable be set. It's used throughout the app. It'll be set by either reading a hashed value on the browser cookie, or after having the user login. In the WebForms + Master Page model, I'd check the Page_Load() of the master page. Perhaps not the ultimate event, but it was an easy one to find. How would you check and enforce the existance of a session variable in ASP.NET MVC? Consider that this question might not involve user login details, but some other piece of data (first visit time, perhaps).

    Read the article

  • MVC 1.0 FormCollection wiped out by running SSRS report

    - by Dale
    I have an MVC 1.0 app with a form that works just fine. The app also launches an SSRS using the URL ReportServer interface (**Not the Webform ReportViewer Control!). This also works just fine. But if I export the generated SSRS report (say to .pdf), and then return to the MVC application, no form will work. By "not work" I mean that on the Post action, the form collection is not returned. I'm completely lost as to what could be causing this behavior. Any ideas? Thanks in advance.

    Read the article

  • Can't launch asp.net mvc 2 application from iis 7.5

    - by StuffHappens
    Hello. I'm trying to launch my mvc 2 application from iis 7.5 and get HTTP 403.14 - Forbidden error. That's what I did: 1. Went to add or remove windows fitures checked iis, asp.net, http redirect. Installed all this stuff. 2. Launched Visual studio 2010 (release), created standart mvc 2 project and published it in default web site/ApplicationName 3. Set default DefaultAppPool .Net version to 4.0. I'm the only user of the computer and have admin rights. What might be wrong? Thank you for your help.

    Read the article

  • ASP.NET MVC and mixed mode authentication

    - by Alan T
    Hi All I have a scenario whereby I require users to be able to authenticate against an ASP.NET MVC web application using either Windows authentication or Forms authentication. If the user is on the internal network they will use Windows authentication and if they are connecting externally they will use Forms authentication. I’ve seen quite a few people asking the question how do I configure an ASP.NET MVC web application for this, but I haven’t found a complete explanation. Please can someone provide a detailed explanation, with code examples, on how this would be done? Thanks. Alan T

    Read the article

  • Blackberry support for Forms Authentication - ASP.NET MVC app

    - by Derek Mitchell
    I'm writing an ASP.NET MVC application that uses Forms Authentication. The target clients are a variety of mobile web browsers. When I use the BlackBerry 8530 simulator my MVC app authenticates as expected. I can visit pages whose controller methods are decorated with the [Authorize] attribute - no problem - they display and therefore I assume my Forms Authentication is working correctly. Using a physical Windows Mobile device to browse my site, I have the same experience as the BB simulator, the forms authentication works as I would expect. BUT when I try to visit the site using a Blackberry 8900 physical device the Login page keeps on looping back when I click the Login page. The device is not retaining it's "authenticated" status. I added code to verify this and I can see that: Request.IsAuthenticated: False User.Identity.IsAuthenticated: False So my question is what next steps can I take to try and find out why the Blackberry 8900 is losing it's authentication status. Is this cookie related? Anyone have any ideas? Cheers Derek

    Read the article

  • JavaScript and CSS files for ASP.NET MVC 2 EditorTemplate user controls

    - by Zack Peterson
    I'm using an EditorTemplate DateTime.ascx in my ASP.NET MVC 2 project. <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DateTime>" %> <%: Html.TextBox(String.Empty, Model.ToString("M/dd/yyyy h:mm tt")) %> <script type="text/javascript"> $(function () { $('#<%: ViewData.TemplateInfo.GetFullHtmlFieldId(String.Empty) %>').AnyTime_picker({ format: "%c/%d/%Y %l:%i %p" }); }); </script> This uses the Any+Time™ JavaScript library for jQuery by Andrew M. Andrews III. I've added those library files (anytimec.js and anytimec.css) to the <head> section of my master page. Rather than include these JavaScript and Cascading Style Sheet files on every page of my web site, how can I instead include the .js and .css files only on pages that need them--pages that edit a DateTime type value?

    Read the article

  • Multiple skins in ASP.NET MVC using StringTemplate

    - by Jamie
    I am considering the StringTemplate view engine for my ASP.NET MVC application. This application will be built with one skin, but I then expect many more, often very similar skins to be developed for it. This is primiarly the reason for my choice of StringTemplate as the view engine, as there will be zero logic in the views. In my head, I envisaged having each skin in a directory under the 'Views' directory in the folder structure, then maintaining a data structure which maps hostnames to skin directories. An obvious disadvantage of this approach is that I will have to explicitly specify my view files - an alternative might be to hack the implementation of the View() method to change the /views/controller/action standard path and insert an extra layer. Is anyone aware of any examples of implementations along these lines using ASP.NET MVC and StringTemplate at present? Can anyone forsee any potential problems with my approach? Thanks in advance.

    Read the article

  • How to return a MVC View to a $.Ajax JSON POST

    - by flascuba
    I am sending a $.Ajax POST to a MVC Controller function with parameters and returning a JasonResult successfully. What I need to happen is that the current View be returned (as if it was not a JSON request and I was returning the Viewdata). The Viewdata has been updated and the page needs to be redrawn. In short, I want the MVC Action to respond back to the $Ajax request correctly, and then have the page redrawn using the updated Viewdata. Hope this makes sense, coming down with a bad cold.

    Read the article

  • Spring MVC absolute URL problem

    - by Umar
    Background I am developing an application (with Spring MVC) with its base path as: http://localhost:8080/myapplication/ I have a stylesheet /css/style.css that I am trying to refer with absolute path in a JSP as: <link rel="stylesheet" href="/css/style.css" type="text/css" media="screen, projection"> Problem The stylesheet never loads in the browser. When I follow the stylesheet link through browser's view source feature, the link appears to be: http://localhost:8080/css/style.css Which should have had been: http://localhost:8080/myapplication/css/style.css I used to fix this issue with html:rewrite tag while working with Struts. Is there any equivalent tag/technique in Spring MVC? Thanks for your time.

    Read the article

  • GetAllUsers - MVC

    - by Jemes
    I’m using the Membership Provider and would like to display a list of all the users and their First Name, Last Name etc using the GetAllUsers function. I'm having trouble understanding how to implement this function in MVC. Has anyone implemented this in MVC or is there an easier way to list all the users in my application? Any help or advise would be really helpful. Controller public ActionResult GetUsers() { var users = Membership.GetAllUsers(); return View(users); } View Model public class GetUsers { [Required] [DisplayName("User name")] public string UserName { get; set; } [Required] [DisplayName("User name")] public string FirstName { get; set; } } View <%= Html.Encode(item.UserName) %> Error The model item passed into the dictionary is of type 'System.Web.Security.MembershipUserCollection', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[Account.Models.GetUsers]'.

    Read the article

  • Multi page forms on ASP.NET MVC

    - by Jay
    Hi, I have decided to use ASP.NET MVC to develop multi page (registration) forms in asp.net. There will be two buttons on each page that allows the user to navigate to the previous and next page. When the user navigates back to a page they recently filled out, the data should be displayed to them. I understand ASP.NET MVC should remain stateless but how should I maintain page information when the user navigates back and forth. Should I? Save the information to a database and retrieve information for each page change? save information to the session? Load all the fields and display only whats's needed with javascript? This registration form is going to be used in multiple sites but with different sets of questions (Some may be the same). IF performance is a main concern, should I avoid generating these forms dynamically? Jay

    Read the article

  • ASP.Net MVC view unable to see HtmlHelper extension method

    - by larryq
    Hi everyone, We're going through an ASP.Net MVC book and are having trouble with using an extenstion method within our view. The Extension method looks like this: using System; using System.Runtime.CompilerServices; using System.Web.Mvc; namespace MvcBookApplication { public static class HtmlHelperExtensions { public static string JQueryGenerator(this HtmlHelper htmlHelper, string formName, object model); } } We use the extension method in our view like this: <%=Html.JQueryGenerator("createmessage", ViewData.Model)%> The problem is, that line of code says JQueryGenerator isn't a recognized method of HtmlHelper. I believe we've got the correct references set in the web project, but are there other things we can check? There's no using statement for views, is there?

    Read the article

  • How to use HTML-5 data-* attributes in ASP.NET MVC

    - by sleepy
    I am trying to use HTML5 data- attributes in my ASP.NET MVC 1 project. (I am a C# and ASP.NET MVC newbie.) <%= Html.ActionLink("« Previous", "Search", new { keyword = Model.Keyword, page = Model.currPage - 1}, new { @class = "prev", data-details = "Some Details" })%> The "data-details" in the above htmlAttributes give the following error: CS0746: Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access. It works when I use data_details, but I guess it need to be starting with "data-" as per the spec. My questions: Is there any way to get this working and use HTML5 data attributes with Html.ActionLink or similar Html helpers ? Is there any other alternative mechanism to attach custom data to an element? This data is to be processed later by JS.

    Read the article

  • SEO: Duplicated URLs with and without dash "/" and ASP.NET MVC

    - by Guillermo Guerini
    Hello guys, after reading this article "Slash or not to slash" (link: http://googlewebmastercentral.blogspot.com/2010/04/to-slash-or-not-to-slash.html) on Google Webmaster Central Blog (the oficial one) I decided to test my ASP.NET MVC app. For example: http://domain.com/products and http://domain.com/products/ (with "/" in the end), return the code 200, which means: Google understands it as two different links and likely to be a "duplicated content". They suggest to choose the way you want... with or without dash and create a 301 permanent redirect to the preferred way. So if I choose without dash, when I try to access http://domain.com/products/ it will return a 301 to the link without dash: http://domain.com/products. The question is, how can I do that with ASP.NET MVC? Thanks, Gui

    Read the article

  • mvc presentation model best-practices

    - by Andrew Florko
    Hello, everybody How do you usually convert business objects to presentation? For example: Business object Person { Id, FirstName, LastName, Patronymic ... } should be presented as "LastName F. P. " in html layout. We use Presentation classes hierarchy to represent data ready for output from Business model. Questions: Will you keep presentation model completely separated from Business Model. For example, can strong-typed views (MVC ASP.NET) aggregate formatted business data as well as raw business objects (that leads toward <%=Html.Encode(PersonHelper.ToShort(Model.Person))% html layout injections) What architecture layer do you choose for conversion (mvc controllers that formats business data from business layer, for instance). Thank you in advance

    Read the article

  • ASP.NET MVC Response Filter + OutputCache Attribute

    - by Shane Andrade
    I'm not sure if this is an ASP.NET MVC specific thing or ASP.NET in general but here's what's happening. I have an action filter that removes whitespace by the use of a response filter: public class StripWhitespaceAttribute : ActionFilterAttribute { public StripWhitespaceAttribute () { } public override void OnResultExecuted(ResultExecutedContext filterContext) { base.OnResultExecuted(filterContext); filterContext.HttpContext.Response.Filter = new WhitespaceFilter(filterContext.HttpContext.Response.Filter); } } When used in conjunction with the OutputCache attribute, my calls to Response.WriteSubstitution for "donut hole caching" do not work. The first and second time the page loads the callback passed to WriteSubstitution get called, after that they are not called anymore until the output cache expires. I've noticed this with not just this particular filter but any filter used on Response.Filter... am I missing something? I also forgot to mention I've tried this without the use of an MVC action filter attribute by attaching to the PostReleaseRequestState event in the global.asax and setting the Response.Filter value there... but still no luck.

    Read the article

  • Using ASP.NET MVC, Linq To SQL, and StructureMap causing DataContext to cache data

    - by Dragn1821
    I'll start by telling my project setup: ASP.NET MVC 1.0 StructureMap 2.6.1 VB I've created a bootstrapper class shown here: Imports StructureMap Imports DCS.Data Imports DCS.Services Public Class BootStrapper Public Shared Sub ConfigureStructureMap() ObjectFactory.Initialize(AddressOf StructureMapRegistry) End Sub Private Shared Sub StructureMapRegistry(ByVal x As IInitializationExpression) x.AddRegistry(New MainRegistry()) x.AddRegistry(New DataRegistry()) x.AddRegistry(New ServiceRegistry()) x.Scan(AddressOf StructureMapScanner) End Sub Private Shared Sub StructureMapScanner(ByVal scanner As StructureMap.Graph.IAssemblyScanner) scanner.Assembly("DCS") scanner.Assembly("DCS.Data") scanner.Assembly("DCS.Services") scanner.WithDefaultConventions() End Sub End Class I've created a controller factory shown here: Imports System.Web.Mvc Imports StructureMap Public Class StructureMapControllerFactory Inherits DefaultControllerFactory Protected Overrides Function GetControllerInstance(ByVal controllerType As System.Type) As System.Web.Mvc.IController Return ObjectFactory.GetInstance(controllerType) End Function End Class I've modified the Global.asax.vb as shown here: ... Sub Application_Start() RegisterRoutes(RouteTable.Routes) 'StructureMap BootStrapper.ConfigureStructureMap() ControllerBuilder.Current.SetControllerFactory(New StructureMapControllerFactory()) End Sub ... I've added a Structure Map registry file to each of my three projects: DCS, DCS.Data, and DCS.Services. Here is the DCS.Data registry: Imports StructureMap.Configuration.DSL Public Class DataRegistry Inherits Registry Public Sub New() 'Data Connections. [For](Of DCSDataContext)() _ .HybridHttpOrThreadLocalScoped _ .Use(New DCSDataContext()) 'Repositories. [For](Of IShiftRepository)() _ .Use(Of ShiftRepository)() [For](Of IMachineRepository)() _ .Use(Of MachineRepository)() [For](Of IShiftSummaryRepository)() _ .Use(Of ShiftSummaryRepository)() [For](Of IOperatorRepository)() _ .Use(Of OperatorRepository)() [For](Of IShiftSummaryJobRepository)() _ .Use(Of ShiftSummaryJobRepository)() End Sub End Class Everything works great as far as loading the dependecies, but I'm having problems with the DCSDataContext class that was genereated by Linq2SQL Classes. I have a form that posts to a details page (/Summary/Details), which loads in some data from SQL. I then have a button that opens a dialog box in JQuery, which populates the dialog from a request to (/Operator/Modify). On the dialog box, the form has a combo box and an OK button that lets the user change the operator's name. Upon clicking OK, the form is posted to (/Operator/Modify) and sent through the service and repository layers of my program and updates the record in the database. Then, the RedirectToAction is called to send the user back to the details page (/Summary/Details) where there is a call to pull the data from SQL again, updating the details view. Everything works great, except the details view does not show the new operator that was selected. I can step through the code and see the DCSDataContext class being accessed to update the operator (which does actually change the database record), but when the DCSDataContext is accessed to reload the details objects, it pulls in the old value. I'm guessing that StructureMap is causing not only the DCSDataContext class but also the data to be cached? I have also tried adding the following to the Global.asax, but it just ends up crashing the program telling me the DCSDataContext has been disposed... Private Sub MvcApplication_EndRequest(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.EndRequest StructureMap.ObjectFactory.ReleaseAndDisposeAllHttpScopedObjects() End Sub Can someone please help?

    Read the article

  • ASP.NET MVC Validation - localisation of the error string

    - by gmang
    I followed the techique ASP.NET MVC 2: Model Validation from Scott Gu. (http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx). However I am building a localised web site. How can I localized the error string? I tried the following by replacing the following: [RegularExpression(@"\d{4}",ErrorMessage="Must be a 4 digit year")] public Nullable YearOfWork { get; set; } With the following: [RegularExpression(@"\d{4}",ErrorMessage=Resources.SharedStrings.search_error1)] public Nullable YearOfWork { get; set; } but I get a complilation error: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type Please help!

    Read the article

  • SSL Form Post in ASP.NET MVC 1.0

    - by goombaloon
    I'd like to use SSL for the post action on the login page of my MVC 1.0 app. I've seen some articles related to the [RequireSSL] attribute in ASP.NET MVC Futures. However, since this works using a redirect, I assume it's not an option (can't redirect a POST, correct?). Ultimately, my goal is to get the Html.BeginForm method to render "https://..." as the form's action so that I can secure the information being posted (login info). How have others handled this?

    Read the article

  • Registering IWindsorContainer with ASPNET MVC 2.0 Areas

    - by Bernard Larouche
    I had the following code that was working well before the addition of Areas in MVC 2 : protected override IWindsorContainer CreateContainer(string windsorConfig) { IWindsorContainer container = new WindsorContainer(); container.Register(Component.For<IUnitOfWorkFactory>() .ImplementedBy<NHibernateUnitOfWorkFactory>()); container.Register(AllTypes.Of<IController>() .FromAssembly(typeof(HomeController).Assembly) .Configure(t => t.Named(t.Implementation.Name.ToUpper()) .LifeStyle.Is(LifestyleType.Transient))); return container; } It doesn't work anymore with MVC 2.0 Areas feature. Could you guide me through a possible solution Thanks

    Read the article

  • MVC in a Google App Engine Java world

    - by thatismatt
    I'm coming to Java from C# & ASP.NET MVC, I'd love to find an equivalent in the Java world that I could use on the Google App Engine. I've already started to have a play with FreeMarker and even made the first steps towards writing a very simple framework. Ideally I wouldn't have to do all the hard work though, someone must have done this already! So my question is - what frameworks are there out there that would be familiar for me coming from ASP.NET MVC and I could use them on Google App Engine for Java. The key things I'd want are: Simple Routing - /products/view/1 gets mapped to the view action of the products controller with the productid of 1 Template Engine - some way of easily passing 'ViewData' to the view, and from the view easily accessing it, ideally I'd love to avoid anything that is too XMLy (thus why I like FreeMarker).

    Read the article

  • Trouble setting a default controller in MVC 2 RC Area

    - by mannish
    This should be simple, but alas... I've set up an Admin area within my MVC 2 project (single project areas). I've created a couple controllers and their respective view folders. In the AreaRegistration.RegisterArea method, I've specified that I want the default controller to be "Dashboard": public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Admin_default", "Admin/{controller}/{action}/{id}", new { controller = "Dashboard", action = "Index", id = "" }, new string[] { "Admin" } ); } If I navigate to url/Admin/Dashboard, the index comes up just fine. What I want, though, is to allow the user to go to url/Admin/ and see the same thing. When I do this, however, I get "The resource cannot be found". I'm just getting my feet wet with MVC 2's Area implementation, and I don't think I'm doing anything overly complicated... Anyone had the same problem? Do I need to specify a separate route, perhaps at the root, non-area level?

    Read the article

< Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >