Using ASP.NET MVC with Javascript Google Charts - c#

I wish to use Google organisational chart within my ASP.NET MVC project. I am however finding it difficult to get my head around how this would fit into the MVC architecture.
The Javascript to generate the chart will be contained in the head of my file and as this data will reguarly change, it needs to dynamically be created. Can anyone give me any tips on where to begin with this?

take a look at this page. Scott Gu talks about Sections in MVC 3. I've used this before to create a section in the head tag to place script block/styles that apply to only one page, this gives you the freedom to use page specific script/styles without make your DOM a jumbled mess.

Related

How do I add a jquery-terminal to a view in my c# ASP.NET MVC app?

Aside from some simple introductory tutorials and messing around with the default template, this is my first ever ASP.NET app and I'm a bit overwhelmed with all of the configurations, folders, features. I want to add the jquery terminal found here
https://terminal.jcubic.pl/
to one of my html pages, however the instructions on how to do that aren't very helpful. Where do I even unzip / install it once it's downloaded? And once that's in the right place, how do I reference it / include it in an html page? Does it need to go in a bundle? Any help would be much appreciated.

How to display a working hyperlink in mvc .net

I currently have an .net Mvc web project that displays comments that are submitted by users and are stored in a database.
I was wondering if anyone had any information on how to embed a link in the comment so that is can be clicked on and followed to the desired well link :)
I am aware that I can google this however with the language in this given question finding an answer on google has been quite basic and not too accurate.
Well you can store the comments as html in the database then display it using Html.Raw but that opens up many security flaws. The best option is to setup some custom tag to represent a link such as [url link="example.com]click here[/url] and then using a razor helper parse that and transform it into a html link.

Make a wizard on ASP.NET site

I'm absolutely new in ASP.NET.
I've got a web site running under umbraco cms (ASP.NET). I need to create a simple wizard: step by step user will answer questions using simple controls (checkboxes, dropdown lists, radiobuttons, textboxes, etc.). Some steps depends on previous answers, some of them doesn't.
So, I've got 2 questions on this:
What is the best practice to create wizard on ASP.NET web site? I looked at System.Web.UI.WebControls.Wizard class here but I'm not sure it's a good approach to mix asp.net controls and html markup together, especially paying attention to the fact, that every step of the wizard is described in one huge markup file.
I've got the samples of html markup of wizard steps (static aspx pages). That's why I want to divide html and logic. I want to be able to apply new design and markup in the future, not changing code. What is the best approach for this - dividing html and c# code?
Examples are welcome.
Thanks in advance.

Use Wordpress Template in c# project

There are plenty of Wordpress template out there, most of them are well designed.
I like to know, is there a way to easy to use Wordpress template in c# project.
Is there any out-of-the-box solution?
Just grab a copy of the output HTML and the CSS of the WP site and apply/build your ASP.NET site around it. This is straightforward in itself. Where most people get confused is when there's a master page in the mix in ASPNET; however, this is not a problem. Just start (with the HTML produced by the WP site) by creating the main divs working from the outside-in, using the master page and then content areas in your pages. Master page(s) will generally contain display elements common to all or a subset of pages.
No, there is nothing "out-of-the-box".
You will need to write your own converter if you wish to do this, though translating a single page shouldn't be too difficult.

Razor chart recommendation

I am currently doing an mvc3 razor project and I need some charts.
I will need to blend bars and lines in a single chart or/and have multiple dataseries.
I was just wondering which charts you guys use. Price is a factor but I would like to hear some real world usage before trying out to many of the thousands of the charts available.
We're currently using Google Chart Tools. It uses HTML5/SVG technology (adopting VML for old IE versions) so it's all rendered on the browser. The JavaScript API is really powerful yet pretty simple to understand and very flexible allowing you to customize almost everything from the data to the presentation. Because it's all rendered in browser it also offers very nice and clean animations on mouse-over and mouse-click.
You've detailed documentation for each type of chart.
Check the default charts here. Also available are the Additional Charts which are compliant with DataTable protocol (a way to represent charts data through JavaScript) and are somehow approved by Google.
It's free!
I've used HighCharts before and find the API very nice to use, also as its essentially a Jquery plugin using a JSON result in your Razor view would integrate nicely.
You can use the ASP.Net chart controls in an MVC Razor project, although not quite as easily as it is in .aspx pages.
See Charts in ASP.Net MVC 2 With Drill-Down! for an example using .aspx syntax that can easily be converted to Razor syntax.

Categories