umbraco7

Umbraco AJAX partial view controller action call - unable to retrieve the Umbraco.Context

青春壹個敷衍的年華 提交于 2019-12-20 04:16:31
问题 I have the following scenario: Calendar page that loads the initial sale nodes from last 2 months. This page has a Load more button that fetches more Sale items that are 2 additional months of Sales . I have added the call to the to controller action like this: public ActionResult LoadMoreSales(int months = 0) { if (Request.IsAjaxRequest()) { if (Request.QueryString["department"] == null) { return PartialView("Calendar/_Sales", GetSales(0, months)); } else { int depId = 0; Int32.TryParse

how to remove /umbraco/surface/ from URL?

こ雲淡風輕ζ 提交于 2019-12-19 11:26:32
问题 My Umbraco URL has /umbraco/surface/ in them. For example: http://localhost:50656/umbraco/Surface/HealthInsurance/Application?Pid=26665&Lid=73&Spid=23 http://localhost:50656/umbraco/Surface/HealthInsurance/Results/73 Is it possible to rewrite url for browser display and remove /umbraco/surface/ from it ? I don't want to break just for browser display make url like one below: http://localhost:50656/HealthInsurance/Application?Pid=26665&Lid=73&Spid=23 http://localhost:50656/HealthInsurance

Working with non-Umbraco data in MVC and Umbraco project?

心不动则不痛 提交于 2019-12-19 02:59:13
问题 I am working on a project that has MVC 4 and the Umbraco CMS installed. I apologise - being newbie, my question may be weird. My question is: how do I work with types which I don't want to manage through Umbraco back office?Rather, it will be simple data coming and being stored in SQL Server. Specifically I want to ask: Can I create a controller in MVC and bypass Umbraco? What controllers should be inherited from? Should they be standard MVC Controller, SurfaceController or

SQL-Server Query not executing correctly in Umbraco C# Controller

只谈情不闲聊 提交于 2019-12-14 02:47:43
问题 So my code seems to be running fine, no exceptions or errors being thrown, however when I check my db table after the "import complete" alert jumps, there is nothing there. PLEASE NOTE: I am referring to the query in the SaveLT function Here is my C# controller: using UmbracoImportExportPlugin.Models; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Web; using System.Web.Mvc; using Umbraco.Core.Persistence; using Umbraco.Web;

excluding folders from Visual Studio 2015 publication

☆樱花仙子☆ 提交于 2019-12-14 02:20:24
问题 I need to exclude folders media, umbraco and umbraco_client from the publication of the project. These folders are rarely changed and I do not want to wait each time until they are copied during the publication on the FTP server. Here is my config local.pubxml: <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <WebPublishMethod>FileSystem</WebPublishMethod> <LastUsedBuildConfiguration>Release<

Model.Content.GetPropertyValue instead of Umbraco.Field

半腔热情 提交于 2019-12-13 20:23:32
问题 Here is part of my code: @using Umbraco.Web; @inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ var mTest = Model.Content.GetPropertyValue<string>("info", true); } <div> @mTest </div> It is impossible to get the content of info property. I am getting the following error: Object reference not set to an instance of an object . From the other side, everything works fine by using: @Umbraco.Field("info", recursive: true) However, I want to use the first approach. I'd appreciate any help on that. 回答1

Umbraco upgrade from 7.2.8 to 7.4.3 throwing error for Azure

泄露秘密 提交于 2019-12-13 06:28:15
问题 I have upgraded umbraco version in 3 steps: Umbraco upgrade from 7.2.8 to 7.3.0 Umbraco upgrade from 7.3.0 to 7.3.8 Umbraco upgrade from 7.3.8 to 7.4.3 In my solution ImageResizer.Plugins.AzureReader2 was working before upgrade but after upgrade it has stopped working. If I comment out below connection string in my web.config it will stopped throwing an error : <resizer> <plugins> <add name="DiskCache" /> <add name="MvcRoutingShim" /> <add name="AzureReader2" connectionString="" endpoint=""

ActionLink generate empty href using MVC 5 with Umbraco 7

孤者浪人 提交于 2019-12-13 06:00:48
问题 I am using MVC 5 with Umbraco 7. Trying to use ActionLink in my View but the markup it generates have empty href. any idea how to get it working? <a href="">Start Date</a> View: @Html.ActionLink( "Start Date", "SearchV1", "SearchV1", new { sitetypeid = @Request.QueryString["sitetypeid"], leaNo = @Request.QueryString["leaNo"], orderBy = "VacStart" }, null) Controller: public class SearchV1Controller : RenderMvcController { public override ActionResult Index(RenderModel model) { return base

Cant get the image to show in Umbraco7 with razor

老子叫甜甜 提交于 2019-12-13 05:45:13
问题 I have used the media picker as data type for the type, for which the user is going to choose what image they want as the deal image. But for some reason i can't get the razor syntax to show the image. If I make an If statement to check if the page contains an image then it won't. I think this is a problem that occurs because i have misunderstood something. My current razor statement: <img src="@Umbraco.TypedMedia(Model.Content.GetPropertyValue("deal1image")).Url" /> The above code won't show

Async Controller Returning “System.Threading.Tasks.Task`1[System.Web.Mvc.ActionResult]”

孤街浪徒 提交于 2019-12-12 06:13:45
问题 I'm trying to work out why Umbraco 7.2.4 just doesn't seem to handle asynchronous tasks in my ASP.NET MVC controller. I feel like I've read almost every possible stack overflow and umbraco q&a, and tried many possible methods to try narrow down the problem. This is both for Umbraco 7 & MVC 4 and & MVC 5. It works just fine in an MVC project without Umbraco. HomeController.cs: using System.Threading.Tasks; using System.Web.Mvc; using Umbraco.Web.Models; using Umbraco.Web.Mvc; namespace Umbraco