Umbraco Dashboards: custom markup within tabs and specific content page - asp.net-mvc

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

Related

Is there an alternative for #sections in a partial view using ASP.NET MVC?

Continuing on this question Can you use #section in a partial view?, where the answer is no, I'll know if there is an alternative way to use #section in a partial view.
I'll know this because I've got an wysiwyg editor (named CK editor) that I'll use multiple times. This need some scripts that I wouldn't repeat every time on each page. I'll keep it dry.
I'll also that the script tags are on the bottom of the rendered page (in the browser).

MVC Partial View - Link to location on page

Let's say I have an Html page with divs.
If I want to link to a specific location on that page, I can create a url like http://www.example.com#mylocation
Now let say I'm calling that page as a partial view instead. Can I still get to those page locations?
#Html.Partial("_MyPartialView")
Yes, you can still get to those page locations.
Rendering a partial doesn't do anything special; the final HTML is the same as if you pasted the partial's contents into the same place. (You can even access ViewBag and it should have the same variables in it from the controller.)
If you view the final page source, you'll still see your HTML anchors. You can manually append #mylocation in your browser URL and see that it still works.

Understanding MVC tags for nopCommerce

I am new to MVC , and in the application i downloaded and trying to debug i see this mark up
#Html.Widget("body_start_html_tag_after")
#Html.Partial("_Notifications")
#Html.Action("AdminHeaderLinks", "Common")
What does this mean?, #Html.Partial where can I find where the value "body_start_html_tag_after") is defined ?
And this one:
<div class="master-wrapper-main">
#RenderBody()
</div>
Where can i find what #RenderBody does?, this is in a .cshtml file.
I would suggest that you look at a reference like http://www.asp.net/mvc to gain a greater understanding of ASP.Net MVC. Having said that the #HTML.Widget, etc is server side code that gets called during the HTML generation process.
I have heard of nopCommerce but I am unfamiliar with the structure, but #Html is usually used for server side helper methods.
#Html.Partial("_Notifications") is used to add the _Notifications Partial view to the page being rendered.
#Html.Action method will render a html A tag with the href link to the controller and action to be performed.
#Html.Widget I am unfamiliar with but one could assume that it is a helper method.
#RenderBody is used on a master page (usually the shared/_Layout.cshtml) as a server side marker to render the view that comes from the associated controller.

Grails render page inside other

I have a gsp page with a form that I would like to put inside a div in another gsp page. Each gsp page have diferent css configuration for 'body'. Is it possible to that that using in Grails (like render).
Yes. In fact it's pretty simple. Best, extract the "common" part into a separate template (.gsp) file and include it into both pages.
See render for more information.

Can I have form tag inside View in MVC?

Can we put form tag inside view in MVC. I need to keep report controller inside the form tag which is inside the view. It works fine. I am new to MVC, can anybody tell is it the correct way to work with.
Yes, you can put form tags in views. Forms are standard html tags, so it's not a problem. You can also put form tags with runat="server" if you want to render some server controls that require it.

Resources