Search

You searched for the word(s): userid:631602

Matching Posts

  • Re: DropdownList - Not Quite There

    Thank you bradleylandis. Somehow I missed ListBox and MultiSelectList, duh. However, as you point out, the selectedValues ctor param seems to have no effect. You got it to almost work by omitting the dataTextField and dataValueField. It does not work at all if the data source is a generic dictionary. Seems to be a bug. If this bug were fixed ListBox would become minimally usable. However, I would argue strongly that ListBox and DropDownList should automatically bind from ViewData based on the name
    Posted to ASP.NET MVC (Forum) by timtas on 10/14/2008
  • DropdownList - Not Quite There

    I started using MVC with Preview 2, and of course I also use MvcContrib. FormHelper in the contrib project has done a fine job; however, the MvcContrib team has decided to deprecate it because, with Preview 5, MVC has largely caught up. I agree with this strategy, however, as I upgrade an app to Preview 5 I am forced to continue using the deprecated FormHelper in MvcContrib because DropdownList is not quite there. Consider the following example: <%= Html.DropDownList(null, "FavoriteColors"
    Posted to ASP.NET MVC (Forum) by timtas on 10/13/2008
  • DropdownList Does't Bind Like Other Controls?

    I am converting from the obsoleted Html helpers in MvcContrib, and I discovered what seems to be inconsistent behavior in the built-in helpers. I have a view that inherits from ViewPage<Person>, where Person has a property CustomerId. In the view I have: <%=Html.DropDownList( null , "CompanyId" , (SelectList)ViewData[ "companies" ])%> ...and the dropdown list is not assigned the value of Model.CompanyId. At least since Preview 5 it seems all the other Html helpers
    Posted to ASP.NET MVC (Forum) by timtas on 9/15/2008
  • Routing/Redirecting With Parameter First

    I need to support routing/redirecting scenario where the first node after the host is a parameter, like so: " http:\\my.domain.com " is directed to " http:\\my.domain.com\MyController.mvc\Index " " http:\\my.domain.com\Foo " is directed to " http:\\my.domain.com\Foo\MyController.mvc\Index " ...both of which route to: public class MyController { public ActionResult Index( string offer) { } } In the first case, offer=NULL. In the second, offer="Foo"
    Posted to ASP.NET MVC (Forum) by timtas on 9/15/2008
  • Re: ActionMethod is gone :(

    Never mind about my question of a better way to do this. I have found it. Actually I had a a filter attribute on the class, SetMainMenu, and a normal attribute on the methods, MenuContext("Products"). SetMainMenu reflected on the calling method to get the MenuContext attribute and setup the menu correctly. Now MenuContext is a filter attribute which then comes behind SetMainMenu and disables the the current menu item based on its key. No need for reflection. A better approach.
    Posted to ASP.NET MVC (Forum) by timtas on 9/13/2008
  • Re: ActionMethod is gone :(

    Yesterday I discovered this breaking change. I have made a workaround like so: var method = filterContext.Controller.GetType() .GetMethod(filterContext.RouteData.Values[ "action" ].ToString()); This feels really yucky and in fact will break if I ever want to use the AcceptVerbs attribute to translate routes into differently named methods. Does anyone know a more sure way to do this? In case anyone is wondering, "why do you want the method anyway," I will explain. My site has a
    Posted to ASP.NET MVC (Forum) by timtas on 9/13/2008
  • Serious Bug: Preview 5 Renders The Wrong View

    I just wanted to make a post about a serious bug in Preview 5 first mentioned here: http://groups.google.com/group/mvccontrib-discuss/browse_thread/thread/fc74f2722d6e83ab I chased my tail for a long time on this inculding much searching of this forum. I did not see any mention of it here. This is a killer bug, so I thought it should be mentioned here so as to save others time and grief. Basically, if you have two views with the same name for different contriollers (e.g., "Index"), Preview
    Posted to ASP.NET MVC (Forum) by timtas on 9/12/2008
  • Embed Media (i.e., Flash) In MVC View

    I need to embed media in an MVC page (e.g. flash or video). Currently I am testing with a flash file. When my view renders with this: < object id= "presentation" classid= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase= "http://active.macromedia.com/flash7/cabs/ swflash.cab#version=9,0,28,0" width= "400" height= "400" > < param name= "src" value= "/Content/Media/test.swf" > < param name= "bgcolor"
    Posted to ASP.NET MVC (Forum) by timtas on 8/30/2008
  • Re: SmtpCient.SendAsync doesn't work

    Sorry, I should have mentioned in my post the error that I was getting initially. It was: "Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event." I am very surprised that this works for you. Everything that I have read indicates that out-of-the-box, you cannot do async operations from an MVC controller. I tried
    Posted to ASP.NET MVC (Forum) by timtas on 8/23/2008
  • SmtpCient.SendAsync doesn't work

    I want to call SmtpClient.SendAsync from an MS MVC website. MVC does not support this out of the box it seems. I found a post that shows a technique that would seem to allow this, but I cannot seem to get it to work. The post is http://blog.codeville.net/2008/04/05/improve-scalability-in-aspnet-mvc-using-asynchronous-requests/ I have tried to implement this, but I get an error after BeginProcessRequest and before EndProcessRequest. Here's the error: [NullReferenceException: Object reference not
    Posted to ASP.NET MVC (Forum) by timtas on 8/22/2008
Page 1 of 3 (27 items) 1 2 3 Next >