Building your own web controls - c#

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/

Related

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.

Can I use silverlight to replace javascript and JQuery?

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.

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.

Web Application, which route to go?

I'm going to develop a web application based on mathematics. It's going to provide stuff like canvas' showing graphs (quadratics etc.) and also provide an exercise area to test knowledge.
I am stuck as to which route to take. I haven't developed a Web Application before and I am most confident working in C# applications. I would prefer to use C# when creating this but I don't know if that is really appropriate.
I have the following routes that I could go down:
Silverlight - I haven't used this before but it seems to be the most obvious solution to me. I was wondering how hard it will be to develop an understanding of silverlight (xaml etc.)
Java, I haven't any idea about java, but I've heard it has a lot of similarities to C#.
Tclets, my university tutor said he has worked with this before and it's easier to get on the web, and very handy for gui's.
I thought I'd ask this here to get everyones opinion on which path to take, and sum up all the positives and negatives of each route.
Thanks in advance.
If you decide to go the Silverlight route the Silverlight Toolkit has some good graphing samples : Silverlight Toolkit Control Samples - which is itself a Silverlight application.
Using Silverlight is probably the closest you can get to writing a desktop application for the web. The UI is specified in XAML with the application layer in C#. The whole application sits within the Silverlight control and you can generate the menus and other navigation items you need.
It complies to a XAP file which you deploy and then reference from either an HTML page or ASP page.
If you are most comfortable with C# then I would advise developing it in ASP.NET. Heres a starting point: Creating ASP.NET Web Applications
I really can't speak to Java or Tclets but Silverlight will offer you a familiar programming model if you are most comfortable in C#. XAML requires a bit of a learning curve if you don't have any experience with it. You don't have to go 100% Silverlight though - it could be a hybrid HTML (ASP.NET) and Silverlight solution - where Silverlight could primarily be used for the graphing/charting. You could use HTML or a more sophisticated ASP.NET site for the remainder of the content.

What is the best 3rd party GUI framework for application development in C#?

Examples could be Infragistics or DevExpress.
But I'm also looking for your opinions on other frameworks. It could even be WPF if that is your favorite.
Infragistics is very good. I think they have a better product for windows than the web. However, I get very upset using their products sometimes. I just want to find some hidden property, and it is impossible to find. They have way to many properties. Sure, you can do anything with their grid, but it should be easier. All of these vendors are leap frogging each other. You really have to compare all of them every year or two. I am currently using Infragistics on most web and windows project. If I could switch today, I would go to DevExpress for Web and Windows. Everything that Mark Miller and the guys at DevExpress produce is beautiful, and thoughtful. On a side point, you should check out CodeRush and Refacter. I may sound like a salesman, but I am not. I just could no longer code without CodeRush. It would feel like coding with one hand. If you are going to spend $1000 or more on a framework, you should also get CodeRush.
I've used Telerik RAD Controls for Asp.Net and it is a very comprehensive suite of controls that are easily converted to AJAX. The support is top notch, with the forum as a first place to go to for research before contacting the staff.
The client side API is fairly easy to understand, and they have good examples of mixed implementations with client and server side code.
I would say Infragistics
Haven't used it before, but I've heard good things about Telerik. My experience with the Infragistics Web components has been less than stellar. I found there were a lot of hidden features that I required, which were undocumented and had to go hunt around in the sample code for examples.
These toolkits can make sense for intranet applications but when you start providing it out on the web, the functionality can come at the cost of a bigger download for users. Just something to keep in mind.
What frameworks are you looking for? I currently use Janus Grids for grids on the winform side, but DevExpress has an awesome web grid that is amazing.
For current Winforms development my favorite is Infragistics. DevExpress seems to have more Silverlight controls in the works, but Infragistics may deliver.
I don't do much non-web development, but if I do I like to use gtk# for Mono (screenshots). It's much more fun and very easy to program then winforms. WPF looks good to, but I only tried an Hello World.
Infragistics has got good controls for Applications. WinGrid is one of the most important ones which would help you displaying information professionally and is quick.
the only drawback is the time consuming process of contacting their helpdesk or searching for the hidden properties. But they do work after you get to know them !
I would say go for DevExpress seems to be the most elegant, intuitive and well document suite out there.
To see their product offering in action demos.devexpress.com
Do the same for any component suite check out their demos and see which best suit you needs.

Categories