I created an .aspx page for custom section which want some umbraco controls to display.
For this i added the following line in .aspx page.
<%# Register TagPrefix="umb" Namespace="umbraco.uicontrols" Assembly="controls" %>
But i didn't get the controls like UmbracoPanel and Pane..
Can you help me on this.
Did you add controls.dll as a reference to your website project?
Related
In my tab from home page I want to render a partial view returned by an action controller, with custom css. The home page has its own doctype. Using Umbraco v7.
How can I achieve this? I read http://our.umbraco.org/wiki/reference/files-and-folders/dashboardconfig but doesn't specify this.
You can only load a usercontrol (ASCX) in the dashboards.
But that shouldn't stop you from what you want to do.
Put your Html and css in the ASCX and
put your controller code in the .cs file.
update the /config/dashboard.config
And you are set.
What you could do is wrap your partial view in a macro and call the macro inside the ascx (<umbraco:Macro alias="theMacroAlias" runat="server" />)
Update: you can't set a dashboard for a specific content page. The only way to archive something here is to create your down propertyType
I have created a Custom widget in Sitefinity. I want to add a rich Textbox in the widget.
For detail see below images.
Add a rad editor control to your designer .ascx file
<telerik:RadEditor runat="server" ID="RadEditor1" Height="400px" Width="680px" SkinID="MinimalSetOfTools">
</telerik:RadEditor>
You may also need to add telerik web ui refference on the top of the .ascx file in case is not added
<%# Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
if you want to add RadEditor, you needs to perform following steps.
1)In .ascx file add the namespace as shown
<%# Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
2)And replace your textbox with following code.
<telerik:RadEditor runat="server" ID="Mytext" Height="400px" Width="680px" SkinID="MinimalSetOfTools" CssClass="sfTxt">
</telerik:RadEditor>
3)you need to make some changes in the .js file of your widget as well because RadEditor has its own methods to get or set its html. You can use get_html() and set_html() instead of using val() in its .js file
I am getting my hands on MVC 3 and am confused that how do i use UserControls in my project.
I have created a usercontrol (cshtml) file called UserControl.cshtml and i am trying to render it Products.cshtml.
MyUserControl.cshtml resides in Shared folder.
In Products.cshtml:
<div>
#Html.Partial("MyUserControl.cshtml");
</div>
But i am getting this error. I dont know why is it trying to search .ascx file.:
The partial view 'MyUserControl.cshtml' was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Products/MyUserControl.cshtml.aspx
~/Views/Products/MyUserControl.cshtml.ascx
~/Views/Shared/MyUserControl.cshtml.aspx
~/Views/Shared/MyUserControl.cshtml.ascx
Is this the correct way to render usercontrol in mvc 3?
--Update--
This works.
#RenderPage("../Shared/MyUserControl.cshtml")
You do not need to specify the file extension, the view engine will handle that.
#Html.Partial("MyUserControl")
Phil haack has fantastic blog on the way to use Partial page.
http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx
i keep getting Compilation errors when i try to do this . .is there anyway to do this inside the site.master file?
Did you add the master page as an MVC master page?
The Url property that you'rew trying to use comes from the MVC framework's ViewMasterPage class. If you added a regular master page, you need to make it inherit from ViewMasterPage. To do this, change the first line to
<%# Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
Yeah, its a bit on this side of pointless, but I was wondering... I've got all these codebehind files cluttering my MVC app. The only reason why I need these files, as far as I can tell, is to tell ASP.NET that my page extends from ViewPage rather than Page.
I've tried a couple different Page directives changes, but nothing I've found will allow me to identify the base class for the page AND let me delete the codebehind files.
Is there a way to do it?
UPDATE: I'm trying to inherit from a strongly-typed ViewPage! Seems like its possible to inherit from a regular ViewPage...
Delete the codebehind and use a page directive like this:
<%# Page Title="Title" Inherits="System.Web.Mvc.ViewPage" Language="C#" MasterPageFile="~/Views/Layouts/Site.Master" %>
Or, if you want to get rid of the codebehind but still want to use strongly typed view, then read this link: http://devlicio.us/blogs/tim_barcz/archive/2008/08/13/strongly-typed-viewdata-without-a-codebehind.aspx
Here is a cut and paste of what this would look like:
<%# Page Inherits="System.Web.Mvc.ViewPage`1[[ABCCompany.MVC.Web.Models.LoginData, ABCCompany.MVC.Web]]" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" %>
Assuming you don't have any code in your codebehind, why don't you point them all to one codebehind file?
Straight out of the box you should be able to delete the .designer.cs and nothing will break. The other code behind can be useful, for instance if you'd like to strongly type your viewdata.