Some glyphicon not working - Bootstrap Yeti

Just stumbled upon an issue that some glyphicons where not working from Bootstrap Yeti. To solve this I copied the glyphicon  section from the Original bootstrap to the yeti one and the problem was solved.

Hope this helps anyone.

ASP.Net Books

 O'Reilly

 

 

The Descriptor Pattern

 This pattern describes the descriptor pattern, this is a usefull pattern to use in MVC development. You could use it to store your actions and controllers in. In the event that the action or controller needs to be changed you can simply change is in the descriptor rather than changing it at all locations in your code.

    public class Genders
    {
        private readonly string _description = String.Empty;
        private static readonly IDictionary dict = new Dictionary<string, Genders>();
        public static readonly Genders Indifferent = new Genders("Indifferent");
        public static readonly Genders Male = new Genders("Male");
        public static readonly Genders Female = new Genders("Female");
        public static readonly Genders Unknown = new Genders("Unknown");

        private Genders(string description)
        {
            _description = description;
            dict.Add(description, this);
        }

        public override string ToString()
        {
            return _description;
        }

        public static Genders Parse(string description)
        {
            if (dict.Contains(description))
            {
                return dict[description] as Genders;
            }
            else
            {
                throw new NotImplementedException("This description is currently not supported.");
            }
        }

        public static bool TryParse(string description, out Genders gender)
        {
            try
            {
                gender = Parse(description);
                return true;
            }
            catch (NotImplementedException)
            {
                gender = null;
                return false;
            }
        }
        
        public static IEnumerable GetMembers()
        {
            return dict.Values.Cast().ToList();
        }
    }

To use it simply use.

Genders.GetMembers

or any other feature you wish to use.

Accessing the ASP.NET Web Configuration Tool in Visual Studio 2013

As many of you have noticed, the option to select “ASP.Net Web Configuration Manager” is no longer in Visual Studio 2013 Preview. This is due to the removal of the Visual Studio Development Server (or Cassini) from the product. However, we understand that many people have gotten used to using the Tool, and so here are the steps by which you can still run the manager. Note that these instructions only work for sites running on the .NET Framework 4.0 and above.

  1. Open the Command Prompt (not as administrator)
  2. Navigate to the folder where IIS Express is installed on your machine. (c:\Program Files\IIS Express)
  3. In the command line spin up a IISExpress site with the following prompt: “iisexpress.exe /path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles /vpath:”/ASP.NETWebAdminFiles” /port:[port] /clr: 4.0 /ntlm” using the following values for the [param]:
  4. [port] – any port you have free in IISExpress (I use 8082 in the example below)
  5. This should launch an IISExpress instance of the Configuration Manager Site
  6. Open your browser
  7. In the URL enter the following “http://localhost:8082/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=[appPath]&applicationUrl=/” substituting the [appPath] with the absolute path to the Visual Studio Project folder with the solution file in it.
  8. Congratulations, you now have your ASP.net Web Site Adminstration Tool running as before. 

 

 

http://blogs.msdn.com/b/webdev/archive/2013/08/19/asp-net-web-configuration-tool-missing-in-visual-studio-2013.aspx

Adding ViewBag value to @Html.Hidden

If you want to assing a viewbag property to an Html Extension try the following.

 

@Html.Hidden("hiddenDate", (object)ViewBag.myDate.ToString("dd.MM.yyyy"))

 

Intellisense for CSS in VS2013 MVC

A very nice feature which is new in Visual Studio 2013 is the code completion / intellisense for MVC pages. It's a bit faded in the example, but you can see the bootstrap pull-left and pull-right.

 

 

Creating an MVC 5 Controller - Empty (VS2013) - There was an error running the selected code generator

Stumbled upon a problem when trying to create a new empty controller. Need to investigate what is going wrong. Workaround is to create a controller by hand. :(

 

 

 

 

 

 

Visual Studio 2013 First Experience

First experience is that I had to force it to close :)

 

 

Changing the image source using jQuery

You can use jQuery's attr() function. For example, if you img tag has an id attribute of 'my_image':

<imgid="my_image"src="first.jpg"/>

Then you can change the src in jQuery by:

$("#my_image").attr("src","second.jpg");

To attach this to an onclick event, you could write:

$('#my_image').on({'click':function(){
        $('#my_image').attr('src','second.jpg');}});

To rotate the image, you could do this:

$('img').on({'click':function(){var src =($(this).attr('src')==='img1_on.jpg')?'img2_on.jpg':'img1_on.jpg';
         $(this).attr('src', src);}});

Passing ViewData to Html.Partial

If you want to pass more than just a model to your partial page then you can use the following.

Html.RenderPartial(
                      "NameOfThePartial"
                     , TheModel
                     , new ViewDataDictionary(this.ViewData){ { "index", index } }
                     ); 

 

 

In addition to the Viewdata which is already in the dictionary you pass in the additional index value. Hope this is of any help.

Sponsored by

Calendar

<<  November 2018  >>
MoTuWeThFrSaSu
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

View posts in large calendar

RecentComments

TextBox