Search

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

Matching Posts

  • Re: Creating non-visual control

    I created a similiar control recently. Here is some sample code: [ToolboxData( "<{0}:VerifyAccess runat=server></{0}:VerifyAccess>" )] [NonVisualControl( true )] public class VerifyAccess : Control { protected override void OnInit(EventArgs e) { // code to verify access and redirect if needed } protected override void Render(HtmlTextWriter writer) { } } The NonVisualControl attribute stops Studio from displaying the appearance properties. Overriding the Render method stops the
    Posted to Custom Server Controls (Forum) by Michael Carman on 3/30/2008
  • Re: Create a repeater grouped in alphabetical order

    Yes, it is possible. The key is to use a DataList with an embedded Repeater control. < asp:DataList ID= "dlInitials" runat= "server" onitemdatabound= "dlInitials_ItemDataBound" RepeatColumns= "3" RepeatDirection= "Vertical" ItemStyle-VerticalAlign= "Top" > < ItemTemplate > < div > < div >< strong > <%# Container.DataItem %> </ strong ></ div > < div > < asp:Repeater ID= "rptNames"
  • Re: Code Blocks vs. Code Behind

    Yea, this is a good discussion. I personally use a combination of inline code, HTML helpers and server controls. For reason already mentioned in this thread (refactoring, type safey, etc..), I always use inline code when referencing the model. But I do like to use server controls for common HTML blocks. For example, here is a some of code for a simple form. < form action= " <%= Url.Action(new {action="SaveContact", id=ViewData.ContactId}) %> " method= "post"
    Posted to ASP.NET MVC (Forum) by Michael Carman on 3/29/2008
  • Re: Bug in preview 2: Resolving URLs using lambdas

    Ok, I did a little more testing. Apparantly, passing a null or empty value only works if the parameter is defined in the route. To get it to work, I created this method in my HomeController class: public void Test( string title) Then I added the following route: routes.Add( new Route( "home/test/{title}" , new MvcRouteHandler()) { Defaults = new RouteValueDictionary( new { controller = "Home" , action = "Test" , title = "" }), }); With that route in place,
    Posted to ASP.NET MVC (Forum) by Michael Carman on 3/5/2008
  • Re: Bug in preview 2: Resolving URLs using lambdas

    What is the name of your parameter. I was only able to get the null value to work if I named the parameter "id", like this: public void Index(string id) ...
    Posted to ASP.NET MVC (Forum) by Michael Carman on 3/5/2008
Page 1 of 1 (5 items)