Can we add HTML5/Jscript to ASP.Net MVC2 Project - asp.net

I wonder to know if we can add HTML5/Jscript files to ASP.Net MVC2 Project?
If yes , How ?

ASP.NET MVC is a pattern where you have total control over the views. This means that you can write any javascript and HTML markup you like. If you like HTML5, then you can use HTML5.

Related

ASP.NET MVC multi browser compabitibility issues?

Does ASP.NET MVC4 has anything to do with multi-browser compatibility limitations?
In other words: the ASP.NET MVC engine also generates HTML server side which is displayed client side (right??), does it generate "non multi-browser compatible" HTML markup or do those two things have nothing to do with each other?
ASP.NET MVC framework doesnt generate HTML by itself, it use view engines to create HTML like: RAZOR, ASPX, SPARK and etc.
No , asp.net MVC does not magically generate any html. it render wherever you put in your views.
you will have to write your code to be "multi-browser compatible".

Using ASP.NET controls in WebMatrix cshtml pages

I am building a site with WebMatrix using the razor syntax in .cshtml files. However I'm stumped as to how I can use the normal set of asp.net controls that are found in the toolbox in Visual Studio - eg: calendar, panel, radio button list etc... Is it possible to use these or can you only use Helpers with razor?
You cannot use ASP.NET controls with razor / .cshtml.
ASP.NET controls work with the ASP.NET WebForms view engine. Razor is a fundamentally different view engine than web forms.
If you really want to use the 'old' controls, switch to .aspx pages. If that's not an option, look into a UI library like jQuery UI. That should give you a similar set of controls.
Note that in razor a lot of controls like radio button list are obsolete. It takes just a few lines of markup to create the same behavior, without the databinding hassle though.
As an alternative tool, you can use Telerik Tabstrip and pass your .csHtml file as a partial view to it.
Some thing Like this:
#{ Html.Telerik().TabStrip()
.Name("TabStrip")
.Items(tabstrip =>
{
tabstrip.Add()
.Text("My First tab")
.Action("Index", "ControllerName")
.ImageUrl("~/Content/Common/Icons/Suites/mvc.png")
.Content(
#Html.Partial("csHtmlName_1", (List<TypeOfYourData>)ViewData["NameOfrelatedView"]).ToString()
);
tabstrip.Add()
.Text("My Second Tab")
.Action("secondAction", "ControllerName")
.ImageUrl("~/Content/Common/Icons/Suites/sl.png")
.Content(#Html.Partial("csHtmlName_2", (List<TypeOfYourDate>)ViewData["NameOfrelatedView"]).ToString()
);
})
.SelectedIndex(0)
.Render();
}
Please note that you need to install MVC Telerik first.(It's free :) and OpenSource)
You can't use Server Controls in ASP.NET Web Pages. It has been designed as an alternative to Web Forms.
You can use plain HTML or you can use the range of HTML helpers which work in a similar way to the ones in MVC (without the ModelBinding).

Does Wizard Control work in ASP.NET MVC 2 MasterPage?

I have dropped a wizard control on the index page of an asp.net mvc 2 project. The button Next and Previous don't work.
Is the wizard control tailored for ASP.NET MVC2 ? If not can it be fixed and how ?
No it is not. I am pretty sure the WizardControl relies pretty heavily on ViewState which is not in MVC.
I did find this: asp.net mvc 2 wizard
No, the wizard does not work. For simpler wizards -- where you are really just breaking the data entry into pages to make it a bit more platable, we are building single big forms and then using the jquery formwizard plugin to break up the flow. Works like a charm and prehaps more capable than the old wizard was.

Recommend html element theme engine for ASP.NET?

Is it any theme or css framework can apply to ASP.NET?
I work with ASP.NET webform, everybody known web controls generate pure html to work.
But i am not good at graphic design, so I want to find some UI helper.
I already work with jQuery and Ajax Controll Tookit, but it not much help to make a modern UI design.
I have found some commercial library like ComponentArt,DevExpress etc, but is it any free or opensource I can use?
Web Controls generate pure html. The only "odd" item that is added is the id of the control. In ASP.Net 4.0 you can determine how the ID is generated - including eliminating the id generated by the .Net Framework. You can set this in the web.config with the value
<pages clientIDMode="Static">
Read more about ClientIDMode here.
Now, you can add a CssClass to a control and use that to style, which is the best way to go.
You can search google for "ASP.Net Web Page Templates" or "ASP.Net Web Design Templates", but you are still going to have to handle some CSS yourself.

What is the best solution for displaying data in ASP.NET MVC?

I am new to ASP.NET MVC and I want to know your opinion about what is the best way to display some data from database using a <table>... an ASP.NET control or a jqGrid?
In which situation must each of them be used?
I appreciate any tips. Thanks.
If I understand correctly, the MVC model doesn't support the server-side event handling of standard asp.net controls, so I'd say that the jquery grid is definitely the best option.
Asp.net controls cannot be used in asp.net mvc.
The best way is to create a ViewModel classes and declare View as strongly typed.
I could continue but unfortunately don't know what exactly do you need.
Do you mean ASP.NET Controls or ASP.NET MVC Controls?
ASP.NET Server Controls should not be used in this framework... or rather, you should not use anything that relies on postbacks and/or viewstate. There are tricks to get some to work, but YMMV.
If the control is an ASP.NET MVC Control, that's a different story, and it will work ok.
JQuery controls also work since they are javascript controls.
use the MvcContrib grid. it is working fine

Resources