Search Results

Search found 3 results on 1 pages for 'fizzer'.

Page 1/1 | 1 

  • Jquery selector question

    - by fizzer
    Hi, I have a working selector but I just wondered whether there was another way I could write it. Here's the html structure: THIS IS TEXT I WANT TO SELECT item 1 item 2 item 3 I have a click event attached to the nested listitems. In the click event I am trying to select the anchor tag. I have used the follwing selector: $(this).parents('li').children('a') Is this the most efficient way of selecting the anchor tag?

    Read the article

  • Code Golf: Print the entire "12 Days of Christmas" song in the fewest lines of code.

    - by fizzer
    Print all 12 verses of the popular holiday song. By 12 verses I mean the repetition of each line as is sung in the song, ie Verse One: On the first day of Christmas my true love gave to me a partridge in a pear tree. Verse Two On the second day of Christmas my true love gave to me two turtle doves and a partridge in a pear tree. ... Verse N: On the nth day of Christmas my true love gave to me (Verse N-1 without the first line) (line added in verse N)

    Read the article

  • Beginner MVC question - Correct approach to render out a List and details?

    - by fizzer
    I'm trying to set up a page where I display a list of items and the details of the selected item. I have it working but wonder whether I have followed the correct approach. I'll use customers as an example I have set the aspx page to inherit from an IEnumerable of Customers. This seems to be the standard approach to display the list of items. For the Details I have added a Customer user control which inherits from customer. I think i'm on the right track so far but I was a bit confused as to where I should store the id of the customer whose details I intend to display. I wanted to make the id optional in the controller action so that the page could be hit using "/customers" or "customers/1" so I made the arg optional and stored the id in the ViewData like this: public ActionResult Customers(string id = "0") { Models.DBContext db = new Models.DBContext(); var cList = db.Customers.OrderByDescending(c => c.CustomerNumber); if (id == "0") { ViewData["CustomerNumber"] = cList.First().CustomerNumber.ToString(); } else { ViewData["CustomerNumber"] = id; } return View("Customers", cList); } I then rendered the User control using RenderPartial in the front end: <%var CustomerList = from x in Model where x.CustomerNumber == Convert.ToInt32(ViewData["CustomerNumber"]) select x; Customer c = (Customer)CustomerList.First(); %> <% Html.RenderPartial("Customer",c); %> Then I just have an actionLink on each listed item: <%: Html.ActionLink("Select", "Customers", new { id = item.CustomerNumber })% It all seems to work but as MVC is new to me I would just be interested in others thoughts on whether this is a good approach?

    Read the article

1