-1

I am having trouble finding a clear answer on this one. I have an ASP.NET 4.0 Silverlight app, but recently a ton of users are complaining about not being able to use the site on mobile devices and Linux distro's. The app is built on MVVM architecture, and thus we are considering changing the UI to alleviate the complaints. We are leaning toward HTML5, but I'm not sure if this is even technically possible with ASP.NET 4.0. I've seen some posts saying that HTML5 only works with javascript code behinds, and that with ASP.NET 4.5 HTML5 support will be added. Am I understanding this correctly? Maybe it would make more sense to just go with an ASPX UI, what are the advantages of HTML5 over .ASPX? Any help is appreciated.

Josh
  • 1,440
  • 6
  • 24
  • 51

5 Answers5

3

HTML5 is a set of client-side technologies.
ASP.Net is a server-side technology.
They have nothing to do with each-other.

However, it will be easier in ASP.Net MVC.

SLaks
  • 800,742
  • 167
  • 1,811
  • 1,896
  • I may have worded my question badly. In this case what they have to do with each others is that I want to replace my xaml UI with a HTML5 UI. I assume that means converting all of my views to individual .aspx pages containing html5 and javascript maybe. My question is whether I can use my existing .cs codebehinds and viewmodels with the new .aspx "views". Will I be able to bind the html5 elements to properties in the viewmodel similarly to how I do with the xaml elements? – Josh Mar 22 '12 at 21:15
  • 1
    @Josh: HTML5 and XAML are very different. However, look into Knockout.js – SLaks Mar 22 '12 at 21:52
  • I was just reading about that. Correct me if I'm misunderstanding, but it seems like Silverlight is what was allowing us to use C# with MVVM architecture, so if we move away from Silverlight I would have to rewrite all of the viewmodels in Javascript, and all of the views into .ASPX pages containing HTML5 and Javascript, which I can then use with the knockout MVVM pattern. Does that sound about right? – Josh Mar 22 '12 at 21:58
  • C# is a client side technology too. And a mobile app technology. And an embedded computing technology. And... – David Cuccia Mar 25 '12 at 04:58
  • @DavidCuccia: Not for web. You're right, though; I used the wrong term. Fixed. – SLaks Mar 25 '12 at 06:39
  • Looks better now, thanks. If you include Silverlight in "web" technologies, then C# is a client-side technology. – David Cuccia Apr 03 '12 at 05:21
2

I'm really surprised where somebody telling that all the C# code of the ViewModel and xaml code behind replace with Javascript . Is is possible ? Where in MVVM architecture code are huge and all are responsible for higher task(like communicate with service layer or database). Is it possible to convert all C# code in JavaScript.

Even I have seen if a JavaScript function take over 25 lines than it becomes some clumsy fro developer to understand . Simple or small functionality can easy develop with javaScript .

C# is very standard and object oriented language ,to develop LOB it has great role but Javascript is not too much .

I'm think Using asp.net mvc is nice to use HTML5 , see we just need to change UI page look using HTML5 but rest of application functionality should remain Same .

D S
  • 486
  • 6
  • 16
0

You would replace what is currently in the Silverlight plugin that runs in the users browser with some html and javascript instead.

Shaun McDonald
  • 6,016
  • 2
  • 23
  • 22
  • So you're saying that for each view in my sl app, I could create an .aspx page and fill it with html5 and javascript which would make up the UI. Then I would be able to attach these pages to the existing .cs code behinds and would also be able to bind the html elements to properties in my viewmodel similar to how I do with xaml elements? – Josh Mar 22 '12 at 21:03
  • 1
    Yup, that sounds like you are understanding what you need to do. – Shaun McDonald Mar 23 '12 at 13:59
  • You need to convert your C# stuff to html5 standard. – Ashraf Sayied-Ahmad Jan 08 '13 at 22:29
  • 1
    @ShaunMcDonald reading my old stack posts haha I respect the sarcastic response to my stupidity. +1 – Josh Jan 22 '16 at 21:40
  • @ShaunMcDonald sad part is I was so junior it wasn't a sarcastic response at all! As an angular developer now, your response was right on! Replaced silverlight with angular and I'm good now LOL Funny enough, with blazor being available now I could finally run those .cs codebehinds in the browser and rewrite the UI in razor and finally bind that HTML to that C# clientside! – Josh Apr 06 '20 at 19:06
0

HTML5 works in conjunction with Javascript on the client side. You can still use ASP.NET to process data and deliver content server side. Here are some quick links.

http://visualstudiomagazine.com/articles/2011/09/01/pfcov_html5.aspx
http://mvchtml5.codeplex.com/ (I know it's mvc, but it might be helpful regardless.)

Michael Todd
  • 15,795
  • 4
  • 46
  • 69
Dan
  • 187
  • 2
  • 10
0

It is not technically possible with ASP.NET 4.0. ASP.NET certainly needs the upgrade in order to handle any HTML5-producing code behind or 'plug-ins.' I second the notion of ASP.NET MVC. Also it seems you are comparing a car to gasoline when you ask the advantages of HTML5 over ASPX.

Brooks Hanes
  • 419
  • 2
  • 12