asp.net-mvc,razor,kendo-uiView the original page-Collection of common programming errors

UnKnown Error


  • teresko
    jquery ajax asp.net-mvc 2014-2-17 0:46:36
    I have the below code which runs when an option in the drop down list is changed:function ddlSqlList_onchange(listItemId) {$.get(‘/SqlReportList/SqlQuery’, { “listItemId”: listItemId },function (data) { alert(‘succeeded’); $(‘#tbSqlQuery’).text(data); });}”SqlReportList” is my Controller, SqlQuery is an Action and listItemId is an input parameter for that action.public string SqlQuery(string listItemId){ // code here }It works locally fine but when deployed unto our dev server, it doesn’

  • DanScan
    .net asp.net-mvc razor nuget dotnetopenauth 2014-2-17 0:27:33
    My local version of my code runs just fine. But when I do a web deploy I am getting the following exception:Could not load file or assembly ‘System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)The relevant stack trace line is[FileLoadException: Could not load file or assembly ‘System.Web.WebPages.Razor, Version

  • Paul Mendoza
    asp.net-mvc asp.net-mvc-3 2014-2-17 0:22:13
    I have an ASP.NET MVC 3 website and I’m looking for a way to package up a set of views and controllers into an external DLL and hopefully use MEF (Dependency Injection) to load the correct controllers and views.Does anyone know if something like this is possible and any good links to tutorials on the subject?

  • user1477388
    asp.net-mvc vb.net asp.net-mvc-3 2014-2-16 23:21:01
    I have the following code which works:ViewBag.Resources = New SelectList(db1.Tbl_Resources, “Resource_ID”, “Resource_FirstName”)I want to not only show the first name, but also the last name so I tried this:ViewBag.Resources = New SelectList(db1.Tbl_Resources, “Resource_ID”, “Resource_FirstName” + ” ” + “Resource_LastName”)However, it didn’t work because it seems to look for a model property called “Resource_FirstNameResource_LastName.” How can I concatenate these for use in the SelectList() me

  • Stephen Cleary
    asp.net-mvc azure wif 2014-2-16 22:19:14
    I’ve got the WIF tools for VS2012RC, and I’m trying to get my ASP.NET MVC 4 project to use them. I’ve installed the NuGet package for Microsoft.IdentityModel.dll.The MVC project is part of an Azure project, but I have the MVC project selected for startup right now.Currently, I have the “Local Development Test STS” selected (with the default settings). When I execute the following code (in my HomeController Index view):<p>Authenticated: @User.Identity.IsAuthenticated</p> <p>Name

  • Ashok Padmanabhan
    asp.net-mvc stringbuilder mvchtmlstring 2014-2-16 20:14:44
    Is there an equivalent method to MvcHtmlString in .Net 3.5 and lower? I have googled and have not found an answer. I created a helper for MVC 3/.NET 4 that uses MvcHtmlString. However it only runs on .NET 4. I want to code a version of the helper so it can run on Mvc 2/.net 3.5 so i can use the helper on another project which uses this runtime. Would i just use stringbuilder and return Stringbuilder.ToString?

  • Pure.Krome
    asp.net-mvc autoeventwireup 2014-2-16 15:25:43
    when i create an aspx page, the header includes something like this:-<%@ PageLanguage=”C#” MasterPageFile=”~/Views/Shared/Site.Master” AutoEventWireup=”true” CodeBehind=”Create.aspx.cs” Inherits=”My.Mvc.Views.Blah” %>With ASP.NET MVC apps, do we:need to include this AutoEventWireUp attribute? What happens if we set this to false? what does this attribute really do? is it valid for ASP.NET MVC?thanks heaps folks!

  • lejon
    asp.net-mvc asp.net-mvc-3 2014-2-16 14:59:14
    I want a partial view that display some stuff from a website that is not under my control. The data on the website is only available through HTML, and thus I can only retrieve it by querying the web site and parsing the HTML. (The website holds a list of 50 elements, and I only want the top 10.) Now, the data from the website is not changing very frequently, so I imagine that I can retrieve the HTML on an hourly basis, and displaying a cached version on my web site.How can I accomplish this in A

  • Soner Gönül
    c# asp.net-mvc nuget-package ormlite-servicestack 2014-2-16 14:53:20
    I’m getting this error after update with NuGet from v3.9.53:”Could not load file or assembly ‘ServiceStack.Text, Version=3.9.60.0, Culture=neutral, PublicKeyToken=null’ or one of itsdependencies. The system cannot find the filespecified.”:”ServiceStack.Text, Version=3.9.60.0, Culture=neutral,PublicKeyToken=null”The thing is, the NuGet Package installed the v3.9.63.0, I’ve never installed the 3.9.60 version before.What I’ve already done:Remove the Packages and Delete the Bin files, then re-instal

  • Kaleb Pederson
    asp.net-mvc iis-6 wix 2014-2-16 14:44:55
    Here’s some considerations when installing onto IIS-6:Needs to register ASP.NET 4 (likely using aspnet_regiis.exe) Needs to allow for both ASP.NET v2 and v4 Needs to register aspnet_isapi.dll with support for wildcard mappingAnd here’s what I have so far:<iis:WebDirProperties Id=’WebDirProperties’ Script=’yes’ Read=’yesExecute=’no’ WindowsAuthentication=’yes’ AnonymousAccess=’no’ AuthenticationProviders=’NTLM,Negotiate’ /><!– SO has some good posts on selecting the website from a dropd

  • DanScan
    .net asp.net-mvc razor nuget dotnetopenauth 2014-2-17 0:27:33
    My local version of my code runs just fine. But when I do a web deploy I am getting the following exception:Could not load file or assembly ‘System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)The relevant stack trace line is[FileLoadException: Could not load file or assembly ‘System.Web.WebPages.Razor, Version

  • Explosion Pills
    .net asp.net-mvc-3 razor 2014-2-15 15:59:58
    I have a ASP.Net MVC app with Razor. I try to access a collection in the view. Here is my code:@foreach (var question in ViewBag.Questions) {<p>@question.Name</p>foreach (var answer in question.Answers) {<input type=”radio” name=”@answer.QuestionId” value=’@answer.id’ /> @answer.Text<br />} }At foreach (var answer in question.Answers) I get:”The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.”I have a .ToList()

  • Konrad Viltersten
    javascript json asp.net-mvc-4 razor 2014-2-15 14:20:32
    In my CS file I’m executing the following and it works as expected.using System.Web.Helpers; String json = System.Web.Helpers.Json.Encode(null);However, in my CSHTML file I’m executing the following, and here, I get an error about Json not being recognized in the context.@{ Layout = null; } @using TestService.ServiceReference; @using System.Web.Helpers; <!DOCTYPE html> <html> … <script type=”text/javascript”>var output3 = “! @Html.Raw(Json.Encode(ViewBag.MyArray))”; …How ca

  • teresko
    asp.net-mvc asp.net-mvc-4 razor asp.net-mvc-areas 2014-2-14 17:27:04
    I’m building a modular MVC4 app, where each module (=area) is a class library. Models and controllers compile into the .dll, the views get copied into the appropriate folder. At runtime, everything works fine. At design time there is one annoying problem left: When editing a razor view within a class library, Visual Studio doesn’t recognize the System.Web.Optimization Namespace.The name “Styles” does not exist in the current context. The name “Scripts” does not exist in the current context.I tri

  • JarrettV
    dynamic asp.net-mvc-3 razor anonymous-types 2014-2-14 4:24:13
    I’m getting the following error:’object’ does not contain a definition for ‘RatingName’When you look at the anonymous dynamic type, it clearly does have RatingName.I realize I can do this with a Tuple, but I would like to understand why the error message occurs.

  • teresko
    asp.net-mvc razor html-select 2014-2-13 10:35:46
    I am trying to make my code more readable. This is an MVC project i am using an hard-codedViewBag.Origin = new List<SelectListItem>{new SelectListItem { Text = “Born”, Value = “Born”},new SelectListItem { Text = “Donated”, Value = “Donated”},new SelectListItem { Text = “Bought”, Value = “Bought”}}; lot of time in app so i decided to move it into a repository class.public class Repository {public List<SelectListItem> GetOriginList(){List<SelectListItem> originItems = new List<

  • Idrees
    asp.net-mvc-3 razor 2014-2-12 17:40:15
    The idea is that I’m building a CSS file generating service, it’s working just fine. But I need the view file extension to be CSS instead of cshtml so I take advantage of the visual studio intellisense.Any ideas?

  • stephan.peters
    asp.net-mvc razor intellisense 2014-2-12 6:40:51
    I have an external assembly named T4MVCExtensions which is using the System.Web.Mvc namespace. So the classes within this assembly are in the System.Web.Mvc namespace.In my project I have a view and I am trying to use extension methods which reside in this assembly.The System.Web.Mvc namespace has been added (by default) to the config file.The view cannot provide intellisense for these extension methods (with red underline), but it compiles without runtime extensions.How can I make sure that int

  • James123
    jquery asp.net-mvc razor asp.net-mvc-4 jquery-dialog 2014-2-11 21:59:31
    I am planning to use “Are sure …” jquery dialog box. But control action is calling before popup the dialog box.index<ul class=”dropdown-menu”>@{@Html.TryPartial(“_actions”, model)<li> @Html.ActionLink(“Edit”, “Edit”, new {id =model.Id})</li><li class=”divider”></li><li>@Html.ActionLink(“Delete”, “Delete”, new {id =model.Id},new { @class = “delete-link” })</li>}</ul></div> }</td></tr> } </table><div id=”delete-dialog” ti

  • gligoran
    asp.net-mvc visual-studio-2010 web-deployment razor webdeploy 2014-2-11 14:02:27
    I’ve been trying to deploy my ASP.NET MVC 3 Beta Application to my hosting. It supports all the necessary technologies and through trail and error I set the needed references’ Copy Local to True. Then I got the error that my app cannot find the view. It listed .cshtml files it tried. I had those files in my project but they weren’t deployed. I found that Visual Studio 2010 doesn’t set .cshtml files’ property Build Action as Content as it does for the .aspx files.Is there a way to make Visual Stu

  • user2503871
    kendo-ui 2014-2-11 4:25:29
    I have the following jquery in my js file ..$(document).bind(‘ready’, function () {$(“#tabstrip”).kendoTabStrip({animation: {open: {effects: “fadeIn”}}}); )};when i try to load this js file getting the following error0x800a01b6 – Microsoft JScript runtime error: Object doesn’t support property or method ‘kendoTabStrip’Included these css files @Html.Css(Url.Content(“~/Assets/CSS/Kendo/kendo.common.min.css”))@Html.Css(Url.Content(“~/Assets/CSS/Kendo/kendo.default.min.css”))Can any one help in gett

  • teresko
    asp.net-mvc telerik-mvc kendo-ui 2014-2-10 17:59:41
    I am migrating Telerik ASP.net MVC to Kendo ASP.net MVC. In Telerik MVC I bounded column with an object in array and specified object type in Bound call and all worked perfectly.columns.Bound(field.EntityFieldType, field.EntityFieldName).Title(field.DisplayName).Template(g => {<%= g.GetValue(field.EntityFieldId)%>}).Width(field.Width); …….But using Kendo MemberType is ignored and remains null. Is there a different way how I can set a MemberType in Kendo? Or if Kendo uses only Data S

  • Alex
    asp.net-mvc-4 kendo-ui kendo-asp.net-mvc 2014-1-26 2:06:52
    I’m in the process of writing some unit tests for our controllers. We have the following simple controller.public class ClientController : Controller {[HttpPost]public ActionResult Create(Client client, [DataSourceRequest] DataSourceRequest request){if (ModelState.IsValid){clientRepo.InsertClient(client);}return Json(new[] {client}.ToDataSourceResult(request, ModelState));} }The unit test for this is as follows:[Test] public void Create() {// ArrangeclientController.ModelState.Clear();// ActJson

  • teresko
    asp.net-mvc telerik kendo-ui kendo-grid 2014-1-25 12:36:29
    I’m getting the following error when trying to bind a datatable to a Telerik Kendo Grid:Index was out of range. Must be non-negative and less than the size of the collection.I’ve followed Telerik’s example project, but in my code it seems to be failing on the ‘Read’ function of ‘DataSource’:.Read(read => read.Action(“Read”, “Events”))I have ActionResult Read() is currently returning null, just because I wanted to see if it’d even make it to that function. Also, I’ve stepped through and the datat

  • Sagar S. Dhanorkar
    c# asp.net-mvc asp.net-mvc-4 kendo-ui 2014-1-24 11:12:11
    When i run my MVC4 Web application it gives me following error:Could not load file or assembly ‘WebGrease’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IO.FileLoadException: C

  • Jignesh
    asp.net-mvc kendo-ui 2014-1-18 17:19:40
    I am using Kendo UI ASP.Net MVC – Grid – Batch Edit,Upon clicking ‘Save’. Data gets saved in database successfully.But “kendo.web.min.js” is throwing error “Microsoft JScript runtime error: Expected ‘;'”@model IEnumerable<EOL.RecOil.Models.ControllerActionViewModel> @using Kendo.Mvc.UI;<div> @(Html.Kendo().Grid(Model).Name(“Grid”).Columns(columns =>{columns.Bound(p => p.ID).Visible(false);columns.Bound(p => p.ControllerName);columns.Bound(p => p.ActionName);columns.Bound(

  • sarav
    javascript kendo-ui kendo-grid kendo-asp.net-mvc 2014-1-17 10:07:33
    Is there a way to create different type of controls in a KendoUI grid column at runtime? The scenario is, I have 2 columns in my grid. The first column displays a dropdown list which has the some strings like, ‘Name’, ‘StartDate’, etc. When user selects a value from it, I want to show an appropriate control in the 2nd column. If the user picks ‘StartDate’, I want to show the ‘DateTime’ control. Can you please let me know how to do this thru ASP.Net MVC 5 wrapper?Sample Code:@(Html.Kendo().G

  • Rj.
    javascript jquery kendo-ui 2014-1-17 1:03:44
    What am I doing wrong? All I want to do is get some data from an API and display it on the screen:<!DOCTYPE html> <html xmlns=”http://www.w3.org/1999/xhtml”><head><title>Kendo UI Test</title><link href=”styles/kendo.common.min.css” rel=”stylesheet” /><link href=”styles/kendo.default.min.css” rel=”stylesheet” /><script src=”js/jquery.min.js”> </script><script src=”js/kendo.web.min.js”> </script></head><body><div id=”

  • user3039902
    user-interface menu kendo-ui 2014-1-15 19:32:08
    I am using Kendo UI Mobile and using a Drawer via HTML / JS.My drawer works fine but I would like to add items at runtime.Here is my code:LoadMenu: function () {var elem = $(“#MenuUL”);elem.append(“<li km-group-container>”);for (var MenuGroup = 0; MenuGroup <= Framework.AppData.MenuGroups.length – 1; MenuGroup++){elem.append(Framework.AppData.MenuGroups[MenuGroup].Title);elem.append(“<UL>”);for (var MenuItem = 0; MenuItem <= Framework.AppData.MenuGroups[MenuGroup].MenuItems.len

  • Aarti Sharma
    kendo-ui add splitter pane 2014-1-14 13:45:40
    I want to be able add a new pane/ remove an exiting pane from a kendo splitter without reloading other remaining panes. Is it possible with kendo splitter?