loads of useful information, examples and tutorials pertaining to web development utilizing asp.net, c#, vb, css, xhtml, javascript, sql, xml, ajax and everything else...

 



Advertise Here
C-Sharpener.com - Programming is Easy!  Learn Asp.Net & C# in just days, Guaranteed!

Kendo Grid "TypeError: u is undefined"

by naspinski 7/7/2014 8:48:00 PM

possible reason you may find this nondescript error

TypeError: u is undefined

I was getting this strange error while using KendoGrid which I had used many times before and I couldn't figure out why. I was simply calling:
$('#grid').kendoGrid();

On a simple table, nothing special. Turns out it was simply because I had used some <th> in the <tbody>, but it can only be located in the <thead>.

MVC Bundling not working on Azure deploy

by naspinski 1/29/2014 2:50:00 PM

working locally, but not on deploy

When using your bundler, everything may work fine, but quirks often pop up on Azure deployment, these are some of them I came across:

Styles/Javascript not rendering at all

This my be because your names resemble your directory structure, which apparently it does not like. For example, if this is your Bundle:
bundles.Add(new StyleBundle("~/Styles/Metro").Include(
            "~/Styles/Metro/metro-bootstrap.css",
            "~/Styles/Metro/metro-ui-icons.css"));

And you use the render:
@Styles.Render("~/Styles/Metro")

It will not render on Azure! Simply change it so your render string does not resemble your actual directory structure, and it will work:
bundles.Add(new StyleBundle("~/Styles/MetroCss").Include(
            "~/Styles/Metro/metro-bootstrap.css",
            "~/Styles/Metro/metro-ui-icons.css"));

And you use the render:
@Styles.Render("~/Styles/MetroCss")

Notice that the directory is ~/Styles/Metro but the render string is ~/Styles/MetroCss.

If that is not it, be sure you are using
@Styles.Render("~/Styles...")

for css, and:
@Scripts.Render("~/Scripts...")

for Javascript.

Images or Fonts not rendering

This is because you assume things will behave the same when they are up in Azure, which is not always the case. If you have this stuff outside of the ~/Content/ folder, your program will not, by default, know how to handle it. You will get a Controller error if you try to navigate to it manually.

The answer? Simply move everything somewhere within the ~/Content/ folder which MVC makes public by default. Don't forget to update your css and JavaScript accordingly!

Otherwise you can make a controller to handle these requests, but that involves more work.

KendoUI : TypeError: n.slice is not a function

by naspinski 12/17/2013 7:53:00 PM

common error in Kendo UI that has a simple solution

The error:
TypeError: n.slice is not a function

Is not very clear, but it is pretty simple. You are generally using some sort of AutoComplete, DataGrid, etc. This simply means that you are not returning a collection (JSON), but a layer (or more) up from that collection you want to include. For example, you would be returning this JSON:
{
    "TrackingModels":[
        {"Id":17,"Name":"Bill"},
        {"Id":17,"Name":"Bob"}
    ]
}

When what Kendo is expecting is just this:
{[
    {"Id":17,"Name":"Bill"},
    {"Id":17,"Name":"Bob"}
]}

Azure Error - .NET Runtime version 4.0.30319.18033 - Loading profiler failed during CoCreateInstance.

by naspinski 6/6/2013 4:09:00 PM

frustrating profiler error when you aren't actually using a profiler

The other day I was troubleshooting an Azure problem, and I had turned on my profiler:

Once I figured out the problem, I then turned off profiling, then re-published. Now my application would not work at all and I kept getting the error:

.NET Runtime version 4.0.30319.18033 - Loading profiler failed during CoCreateInstance.
Despite the fact that I wasn't using a profiler anymore. I rebooted and tried all sorts of other things, nothing seemed to work.

The Fix

Not to say there is not a better fix (I tried all I could find elsewhere, nothing seemed to relate to my specific problem) but here is what I ended up doing. Simply delete your deployment, and re-publish. This must re-set whatever turning on your profiler sets.

Remember that if this is a non domain dns instance, your address will be changed. Hope this can save someone a few hours.

Tags:

azure