Can I use silverlight to replace javascript and JQuery? - c#

I have a webapplication that heavily uses JQuery. I would like to start using silverlight in its place if its possible. Instead of using jquery ajax features and other jquery features I would like to use silverlight. is this possible to do with silverlight?

Different tools. jQuery is best for manipulating the DOM. Silverlight is (ostensibly) best for rich internet apps, not manipulating the DOM. If your web application tries to create a cool UI using JavaScript, Silverlight might be a good fit to replace tons of JavaScript code.

If you application uses JQuery now replacing it with Silverlight will most likely not only entail redoing your JQuery features but also any HTML, CSS, forms processing and really everything about your application depending on what it does and how it is current designed.
I agree with Jonathon, they are really are two different tools.
Thanks.
Nick
nickgs.com

Technically, Yes.
But you must understand that you will have to rewrite all your application from the bottom. Microsoft propose the RIA Services as the best practice design to use with Silverlight but with this will make you change all your design and even the Data layer.
So the answer is Yes. But you would better stick with jQuery.

#Luke101, you can design an whole website using Silverlight no probs. The question though is what is your target audience?
Silverlight doesn't come shipped with the browsers as yet so a lot of computers don't have it yet and so need to download it.
Given the amount of paranoia out there I think people are a little hesitant to download something when a broswer asks you to.
The environment you'll be working in i don't think will be HTML any longer and you'll be working in xaml.
Also consider your target browser. There are still a lot of people using <gasp> IE6 and i'm not sure if SL will run on it.
What is the motivation behind moving to SL? If it's because it looks cool, don't forget a lot of that comes down to design and if you're not a design person you're likely to make a bigger hash of it than if you were working in HTML.
You may also want to look at how you integrate with a designer. I know MS Expression is designed to make the job easier but it's still an early product. Also, does your designer know about Expression or Blend and know how to use it?
What I'm getting at is there is a large learning curve here which equates to someones money and you may not see anything for some time.

Yes.
Silverlight runs in the browser, jQuery (JavaScript) also runs in the browser. So they can technically replace each other, assuming all the functionality you want in one exists in the other (including support in various browsers).

Yes. Silverlight with RIA services can replace a jQuery AJAX site. Depending on the site's features, you may even be able to break up the features of the site into silverlight "widgets" for individual functionality. The danger is that Silverlight can quickly balloon into an application that is difficult to update (though it will guarantee cross browser compatibility). Silveright is entering version 4 and it's still not finished yet, so it's changing rapidly.

Related

Cross-platform development

I was just about to upload my new, redesigned website when I realised "crap, it's just like every other website."
Then I had an idea. And I've spent the past 2 weeks planning. I have but one thing left to do, and it's proving a little difficult to figure out how I can have my website for PC's, and a whole different site for an iPad (or just larger touch based computers in general) and another for Touch-based phones, and then one for regular phones with web browsing capabilities.
Is this possible? I want separation. I don't want a bunch of javascript files with commands for everything inside them. I want to separate each 'website' and serve it based on the platform requesting the document. How can we achieve this?
If you are to recommend any libraries that may help, note that I will not use jQuery (but list jQuery anyway as others who face this problem might not mind using jQuery)
You can use Asp.net MVC and switch your views depending on the device.
This way you can reuse all your controllers and have different views for each device you want.
Scott Hanselman wrote an article a while ago about this kind of development:
http://www.hanselman.com/blog/MakingASwitchableDesktopAndMobileSiteWithASPNETMVC4AndJQueryMobile.aspx
I would recommend jQuery Mobile to use in mobile devices. I also recommend Kendo UI Mobile, it really looks amazing but the mobile version is not free..
I also suggest to take a look at SPA (Single Page Applications). With SPA you could have a rich javascript application ready for any device. Combining it with Asp.Net WebApi looks very promising.
Jonh Papa made a course on Pluralsight that is completely worth it:
http://www.johnpapa.net/building-single-page-apps-with-knockout-jquery-and-web-api-ndash-the-story-begins/
It's all about thinking about what you really need and how much effort you can put in.
long answer short, i think what you are looking for is Request.Browser to do redirects. You can Access things like Browser.Browser or Browser.Version, i think even a IsMobileDevice is to be found there.
check out: http://msdn.microsoft.com/de-de/library/system.web.httprequest.browser.aspx

What engine to use for creating .net 2 c# application based on HTML layout?

I'm browsing the net now for days, but still couldn't find what I'm looking for. Basically I'd like to develop my application interface, the GUI using HTML and CSS, with of course keeping the events, and the chance to modify parts of the layout at runtime (like a content of a div). The application is a database manager displaying visually the datas, and updating them at runtime.
IE aka using System.Windows.Forms.WebBrowser, this is what I try to avoid, it depends on the client system, stops at version 7, hard to link with the application
HTMLayout - http://www.terrainformatica.com/htmlayout/ : seems interesting, but the .net c# part, the nabu-library is dead
Sciter - http://www.terrainformatica.com/sciter/ : from the same group as HTMLayout, but couldn't really understand the integration, and I'm not sure if this is what I want - also couldn't find .net c# infos
Awesomium - http://awesomium.com/ : which really seems nice at first, but it needs .net 4 , and we have to stay at .net 2 - also it seems too much to handle, to use, and .net wiki is a little weak: http://wiki.awesomium.net/
and finally Gecko http://code.google.com/p/geckofx/ and Webkit http://code.google.com/p/open-webkit-sharp/ - but currently I'm not sure that they can be used to render the whole application, they just seem to be a WebBrowser with another engine.
Did I miss something?
Sciter integration principles are outlined here and here.
Sciter and HTMLayout both use the same integration principles and API architecture.
As of .NET wrapper, check these projects:
https://github.com/midiway/SciterSharp
https://code.google.com/p/expemerent/
Not sure if this fits your requirements but I currently use Webkit.NET http://webkitdotnet.sourceforge.net/
Essentially I use its Webkit Browser Control for the interface, store the HTML/CSS markup as variables and then I use C# to perform server-side logic, then output the results to the Browser Control (C# in this case acting in place of PHP since I am not including a portable web server with my application).
I did want to update it to achieve some newer functionality/standards so this article was most helpful.
http://peterdn.com/post/(First!)-Using-WebKit-nightly-builds-with-WebKit-NET.aspx

C# and ASP.Net. Guidance required

I am a student and do my work and projects in c#.. I have not experienced WEB still. The question I wish to ask is that whenever in or near future if I wish to switch onto developing WEB Applications on ASP.Net, will I experience any difference ?? excluding any syntax changes.. I mean in C# the way do Add Update and Delete Records and the calculations, will I be experiencing the same in ASP.Net??
I don't have any concepts of WEB.I want to ask you people that what do you consider the most important to learn before switching onto ASP.Net?
Guide me please.. :/
There are no differences in server-side code.
The main different is in the UI.
While Microsoft tries to maintain a UI experience similar to Windows applications using its custom controls and the designer, you need a good knowledge in HTML and CSS if you want to create complex UI tasks.
Custom controls actually generate client side code such as HTML, CSS and Javascript.
So your main challenge will be the presentation layer and how to create client side code that is well parsed on different browsers. It's more difficult than Windows' "Drag and drop" technique, but it's quite a lot more powerful.
You'll notice that you can't drag and move controls the way you do with Windows apps, changing their coordinates on the screen.
HTML is not about coordinates, it's based on a certain document flow in manually defined layouts.
Don't be tempted by changing Web controls to absolute positioning, just because you think it's "easier". It's a mistake a lot of migrators to ASP.NET do, and it's generally a huge mistake that I suggest you don't fall into.
If you are talking about the difference between Windows apps and Web apps, the most important and hardest thing will be for you to grasp the page life cycle. Check here for Microsofts overview.
I guess the web and desktop applications have considerable difference. The one and most important is that when on Web there are two states of WEB application
On Server side : where we have C# code and stuff.
Client side : Where we have CSS, HTML and JavaScript doing it all for us.
Besides this HTTP which is communication bridge.
This is one big different that desktop application developer face when they switch to the Web Applications.
I will suggest you to take a look at basics of CSS, HTML and JavaScript while swiching on web applications. That really helps in log term.
First, I'd say if you look into web application, make a few quick examles with ASP.NET WebForms, and then a few with ASP.NET MVC, to learn the differences between good design (MVC with AJAX and without postbacks) and bad design (quick and dirty WebForms with postbacks and without AJAX).
Try using JavaScript on pages, and look at how postbacks reset all JS variables, and the impact that has on anything dynamic. Also look at how postbacks exponentially increase the complexity (and bugs, such as session timeouts with label text stored in session) and decrease the debugability of your application.
Take a look at JQuery, JQuery uploadify and JQuery Treeview, and JQuery DataTable, and JQuery Charts.
Add and UpdateRecords imply editing a DataTable and saving the changes.
This is the worst thing you can possibly get your hands in with ASP.NET, that is, if you want to do it properly (with the possible exception of asynchronous data processing).
If you are really passionate to dive into web application development especially ASP.NET, I would recommend the following path for a beginner to kick start with.
Start learning HTML, JavaScript, CSS
Next you could try Classical ASP. Having a know how of classical ASP will definitely be a plus, when moving to ASP.NET because, you will under stand how ASP.NET renders pages and what ASP.NET controls really does etc etc. In my own words ASP.NET is a chocolate coated version of classical ASP, I am telling this from my classical ASP experience.
Next you need to firm understanding of on how the web works and its internals. If you need you could also refresh on How Internet works and How website works (this too).
Finally you could start off with ASP.NET 2.0 and later move to advanved stuff like AJAX, MVC etc.
You could further enhance you skill by learning jQuery and some CMS (Content Management Tools) like DotnetNuke.

Browser App - RAD UI Development - Is it possible?

I've been away from building browser applications for a long time. I'm now interested in creating one for a hobby of mine. I dread having to deal with HTML, JavaScript etc. to build a high quality browser based user interface. I've got the full suite of Telerik controls. Is it possible to build a polished, somewhat feature rich browser UI while being sheltered from the archaic environment of HTML and JavaScript? I'd love to be able to simply drag-drop components, much like building a Win UI and have the exact HTML, JavaScript code created for me.
Thanks!
Since you have the telerik controls suite, I suggest you have a look at the control demos or the sample applications, to see what's possible without having to program a lot.
In my experience, you can achieve a lot without having to program javascript or HTML (when using the telerik controls). But as soon as your application gets bigger and more complex, you will want to take care of things such as ViewState optimizations or taking advantage of the client-side programming APIs of the telerik controls to optimize your app (e.g. to get a more AJAXy kind of user-experience).
My sentiments exactly, so I now fully recommend to build Web apps with Silverlight (or Flash, but I am .NET guy, so my first thought goes to SL). Using HTML/Javascript is too much work.
SO is a fantastic Web app but I cannot imagine the number of hours spent to achieve this result, especially compared to a "real" programming environment.
MVC + JQuery + Telerik will allow you to be sheltered from a very large amount of the nasty HTML/JavaScript stuff. Silverlight is an option but you'll lose very large potential audience segments that may or may not be important to you (mobile web users, for example).
As somebody else mentioned, the Telerik demos pages are your friend - use them a LOT and you can avoid much of the HTML nastiness.

Building your own web controls

Well it's kind of a newbie question but I think lots of people have problems with this.
I'm developing Windows/web application for fun, and installing them at friends' places. Most of my developing concentrates on the CRM system, but I have a big problem with showing data from DB in better, more effective and lighter ways.
Using Microsoft built-in web controls is a nice and easy way, but it doesn't answer my needs, and worse, it's not that effective as other web controls in great software and websites(Google(lol)).
I want to build my own controls(GridView, etc...). So my question is how can I do this myself?
How does Microsoft build their web controls for both web and Windows Form developing?
Thanks!
Amit
Here's the starting place for learning about creating your own web controls.
http://msdn.microsoft.com/en-us/library/bb386565.aspx
And here's an older reference, but probably a better place to start.
http://msdn.microsoft.com/en-us/library/aa710843(VS.71).aspx
And finally.... If you want to develop custom controls for Windows Forms applications...
http://msdn.microsoft.com/en-us/library/6hws6h2t.aspx
Well, this can be answered several ways. Most of the nice controls are doing a lot of Javascript that is not obvious unless you look at the output. You might be interested in using JQuery plugins (or "controls"). Also, to be honest, you might be interested in persuing a new way of doing ASP.NET, which is called ASP.NET MVC. This is a very good way forward of building Web applications that utilize a lot of Web standard technologies without hiding and obscuring the details. Here's a link to that:
http://www.asp.net/mvc/

Categories