to maintain compatibility with a classic ASP system, I essentially need to build the equivalent of an ASP.NET datagrid (complete with read, insert and update capability) in Classic ASP, are there any tools out there that make this any easier than just simply handcoding tables? I'm fairly rusty at Classic ASP as well so an easy solution is much appreciated, thanks!
You might want to check out ajaxed Datatable
Start with Understanding Datatables
There are no pure "ASP" solutions to this. However there are plenty of commercial Javascript based AJAX backed data grids that can work from an ASP server.
What really are your "compatibility" requirements? Why not do this with ASP.NET?
Of course you might consider using a Silverlight Datagrid, you could make that work with an ASP backend as well.
Related
I have got a bunch of classic asp pages(around 400 pages).However my client doesn't want me to rewrite the application right from the scratch.
I have tried with http://www.asp.net/downloads/archived-v1.1/migration-assistants/asp-to-aspnet/ but it didnt work as I am working on visual studio 2012.
Is there any other way/tool for conversion which is quite easier and faster?
Thanks in advance
ASP.NET is not an updated version of classic ASP but actually something rather different so unfortunately there is no magic bullet and you'll need to review each of your script files and rework each one.
For less up-front rework, you can use VB.NET as your ASP.NET language, and you can also use ASP.NET Forms (as opposed to MVC.) VB.NET gives you a syntactically similar language to VBScript (assuming you weren't using JScript.) Forms gives you a similar structure without having to separate your logic from your content. Very broadly speak an .aspx page is kind of like your .asp page, except you can have code in an extra code-behind page, (.cs.)
However, you should inform your client that if you do that, it will likely be a huge problem from a maintenance perspective later on. Although ther are plenty of VB.NET sites out there, C# is the most common and almost ubiquitous choice as a language for ASP.NET and .NET in general and as time goes by, it will be harder to find people willing to work with VB.NET. (Think how many JScript coders you know with classic ASP and you'll get the picture.) Further, not going with an ASP.NET MVC solution is also somewhat risky from a future-proofing perspective. Most languages are moving to MVC and similar models.
The bottom line is that you'd pretty much end up with a rewrite for a C# MVC solution, but it would be something maintainable down the line, whereas a VB.NET forms solution now would get you a faster conversion but you will likely even now have problems finding good developers who would want to work on it as many will prefer C# projects, given a choice.) A C# and MVC solution would also likely by design be cleaner and easier to maintain too.
Go with asp.net MVC. That's the best way to convert classic asp to asp.net. It will help but can't convert in a minute if you are looking for some conversion tool.
For months, I've been considering downloading Microsoft's express web platform and learning ASP.NET, which I might actually enjoy, seeing as I already do web work with PHP, but am much more comfortable with C#.
However, the primary reason I don't want to do this is that I've always associated ASP.NET with useless spaghetti HTML. The link I posted is an excellent example. Would it be possible to use ASP.NET in a context more similar to PHP, using it to power my site but not leaving the HTML, CSS, and JavaScript to be done by hand for validation and semanticity reasons?
EDIT
I've decided I'm not going to learn ASP.NET and stick with PHP.
While MVC sounds nice, for me it will likely end up being a development/debugging headache.
Things get much better if you use ASP.NET MVC. I recommend you skip ASP.NET WebForms and jump to MVC directly.
If you are going to use Classic ASP.NET Web Forms, you really need to learn how it works to avoid truely ugly html. If you know what you are doing, you can get close to what you want (you can't completely get rid of ViewState & it will do some ugly thing with element IDs)
A lot of the ugliness of Classic ASP.NET occures when people write web forms like they wrote VB 6 Windows applications.
ASP.NET MVC is a good option. It may be the way to go as a starting point; I would like to switch to it myself. I guess my point is that you can get less ugly HTML using Classic ASP.NET.
you're really going to want to check out the asp.net mvc. it allows you to develop in a manner a lot more suited for the web than vanilla webforms.
First of all, ASP.Net, even using webforms, does allow you to have complete control over the markup output. Of course it's easier for some cases than others, but anywhere you find you're not getting the html you want out of a control you can always replace the render behavior with a ControlAdapter.
That said, as others have mentioned you'll probably find it's much easier to get the exact html markup you want using ASP.Net MVC.
MVC.net and WebForms are built upon ASP.net
You can get a decent amount of control with webforms by disabling viewstate and not using any controllers (or very few). Its all in how much you let it do for you
If you are looking to acquire skills in the latest and greatest, then MVC is where you should start but I would also consider whether you will ever be asked to support ASP.Net Webforms. Having an understanding of ViewState is crucial to that end.
For fine grained HTML output, you can produce this in many different ways with classic ASP.Net. There is a growing group of developers who are using a mixture of ASP.Net and microtemplating with Javascript to produce RIA's. This inevitably leads to keeping your html output cleaner so that it can be manipulated with jQuery and CSS.
Learn ASP.NET MVC as it will give you more control over the html generated. Also learning ASP.NET will increase your job opportunities significantly.
My first real development in ASP.NET was with MVC, and I must say I truly miss it now that I'm onto the next project using webforms. Each has it's place and webforms is working pretty well for what I'm doing (also using it as an opportunity to learn about TableAdapters and what not) but I really do miss being able to insert the data I need right into the HTML. That way I know the layout I've built won't get screwed up.
As a framework I enjoy ASP.NET quite a bit, but the controls on the page seems so far removed from anything resembling HTML that there is often a mental disconnect with what I'm typing with what I'm expecting to see. I was that way when I first started HTML though, so I imagine I'll get used to it. When I started with MVC it was overall a much more enjoyable experience coming from a front-end background.
I’m new to .net, though I’ve been writing in classic asp for years. I know it’s time to make the change, but I can’t stand how bloated the HTML becomes.
For example, a simple menu using a web.sitemap and adds over 100 lines of JavaScript and HTML. A simple form with server-side validation adds in masses of ugly JavaScript. And a basic table of data using GridView adds in a ViewState that makes my eyes water.
Call me a purest, though I don’t like sending data to the browser unless it’s needed. And I don’t need a form-riddled menu when a simple unordered list of links will suffice.
So, set in my ways, am I destined to forgo the benefits of the Framework entirely by insisting on writing my own, cleaner code for everything? Or am I missing the point?
As a brief aside I’m a big fan of Campaign Monitor, a newsletter distribution company. They’ve written an elegant and comprehensive user-interface in .net without a single ViewState or bizarre .net-mangeled ID reference. Even the Sign Up form on their website (/signup.aspx) is as clean as a whistle. What’s their secret?
I hope I not the only one. Any advice would be greatly appreciated.
Try ASP.NET MVC or one of the other MVC web frameworks for .NET
If your GridView doesn't need it, then turn ViewState off for it.
Also, please edit your question to say what version of .NET you're using. Some of this gets better, and some does not. You might also want to try VS2010 beta 1, and complain about anything it doesn't fix.
Another idea would be to go on treating ASP.NET like it's classic ASP. Do it exactly the way you're used to, but do it with the idea in mind that there's about 10 years of development work that's gone into solving some of the problems of classic ASP. Once you actually hit one of those problems, find out if ASP.NET has solved it, and how.
For instance, I have a hard time believing you enjoy writing FOR loops to generate table rows. If you get tired of that, learn to use a Repeater control, or a DataList control, or even the old DataGrid control. If you turn ViewState off on those, I think you may find the generated HTML to be acceptable, and you'll find it a lot easier to generate tables and other structures that repeat based on repeating data.
You can opt-out of much of that bloat by not using all the out-of-the-box controls that come with it but I prefer the MVC route that activa suggested
Here is my list:
Keep the use of asp controls to minimum
Turn off Viewstate when it's not need
If you don't want the JavaScript associated with Client Side Validation (with ASP.NET Validation) set the EnableClientScript to False
Use asp:literal instead of asp:Label
Yeah it seems to be that everyone is bashing webforms at the minute for the reasons you have outlined above. HTML heavy Controls, ViewState, no control over ClientIDs all seem to cause an issue with people.
However let is be said that you can use asp.net (webforms) and produce some decent applications.
Control of html is yours through httpModules and httpHandlers and some of the issues mentioned above are fixed in asp.net 4.0
I just listened to a great podcast comparing MVC and webforms. Its in the area you are asking about. Also check out this blogpost by a dotNetNuke regarding the good asp.net code and why people should take a breath before converting everything to mvc.
Having said that I've tried Asp.net MVC and it is awesome. I'd probably look at dotNetNukes code to as its a mature asp.net product.
Also, when you do want to use these newfangled server controls, check out the css friendly control adapters. They clean up much of the bloat.
For client IDs the key thing to remember is to let the framework handle them. If you need to get an element on the client side, remember to emit the control's ClientID property into your script.
I've been using a template system and am very happy with it. Basically write an http handler for .html files and put tokens in the html files that regex could find in one sweep and inject any stuff. (google template c# for more info).
I tried some of the supposedly cool new features of ASP.NET for a little while. I also didn't like most of them. I felt constrained to work within the limitations of the common paradigms Microsoft had dreamed, even though I new how easy it would be to produce the HTML and JavaScript myself to do specifically what I wanted to do without having to learn how to jump through the hoops of so many new Microsoft-specific idiosyncrasies.
Anyway, I stopped using the parts of ASP.NET I didn't like on new code I've been writing lately. When I first started using ASP.NET, nothing in the MSDN documentation jumped out at me about how to avoid such complications, so I posted a couple "Hello, World" at http://www.agalltyr.com/rawaspdotnet.html to help spread the heretical word. I couldn't care less if it's the latest cool technology or the recommended technique. It's a reliable and reasonably efficient tool I can use to do my work.
Oh, and I'm not in the mood to learn ASP.NET MVC either. That's just more idiosyncrasies. Give me a language (C#) and a framework (.NET), and I'll design my own abstraction, thank you.
I have very basic knowledge of Javascript and now I am looking forward to learn Ext JS and implement in in my ASP.NET application.
If anyone can guide me on how to start and which book I should follow, I'd be thankful.
Nor sure if it is the quickest approach, but all I did (as well as another developer that was working with me) was review the ExtJS documentation and samples gallery (and viewing their source).
One big issue to watch out for when using ExtJS with ASP.NET is that when using BorderLayout you will go crazy trying to figure out why Postbacks no longer work. There is a workaround though.
Another ASP.NET gotcha is that if you use ExtJS to talk with ASP.NET web services (or WCF) you have to do some special things to get it to work (adorn your webmethod with special attributes, or add some things to web.config, etc).
Those were the only two gotchas I can recall, other than just learning and getting the hang of ExtJS itself.
I've kept up to date with new features in the C# language as it's moved from version 1 through version 3. I haven't done such a good job keeping up to date with ASP.NET. I feel like some of the post version 1 features are not so good (e.g. the AJAX framework) or are just not that useful to me (e.g. the membership framework). Can anyone recommend any new killer ASP.NET features that might have gone unnoticed?
For ASP.NET, you have a lot of improvements:
split view (code and design)
faster switching between code and design view
embedded master pages (one master page in another)
javascript debugging
Anyway most of the useful stuff are really in the meat of the language, and for .NET 3.5 the new language features for C# 3.0 will be (and yes, I find ALL of them useful)
anonymous objects
automatic properties
object initializers
collection initializers (inline initialization for collections)
implicit typing (var keyword)
lambda expressions
LINQ
Extension methods
I might have forgotten a few, but I think this is about most of the new cool and useful stuff.
Check out the MVC framework which is built ontop of 3.5. Big improvement over the traditional webforms model.
I'm still learning ASP.net so I can't tell you exactly, but if you look through http://www.asp.net/learn/ you'll probably find a few new gems, there's even a 3.5 section.
ListView and its friend DataPager are probably worth looking at, but they're hardly "Killer" features.
Things outside of ASP.NET specifically (LINQ, for example) are probably more likely to be get the "Killer" commendation.
Its the MVC framework. Without 3.5, there is no MVC. Without MVC, ASP.NET is a PITA.
Master Pages
(of course, these are in there from
version 2.0)
Nested master pages are new in 3.5. I haven't used them yet, but I can only imagine they could turn into a hidious nightmare if not used very carefully.
You only have to look at the order in which the events are fired in a page that uses a master page to think 'urgh'.
I don't think the MVC Framework is quite ready for prime time yet
Just an FYI, this site is built in MVC.
I also have 2 apps in production on mvc, I would argue that its definitely ready for prime time.
#IainMH Nested Master Pages were always supported by ASP.NET, just not by the designer.
As others have said, there's a good list at www.asp.net/learn. I think the biggest ASP.NET specific changes are:
Official ASP.NET AJAX integration
ListView (much better than the GridView / DataView in that they let you write out clean HTML)
Big improvements to the IDE for CSS / HTML editing
Javascript debugging
Note that ASP.NET MVC is not released yet, and was definitely not included with ASP.NET 3.5.
Here's a brief list of my favourites:
LINQ
Extension Methods
Lambda Methods
And I don't actually use ASP.NET, but ASP.NET AJAX is now included in 3.5 too and ASP.NET MVC is included in 3.5 SP1.
I don't think the MVC Framework is quite ready for prime time yet, though I definitely plan to use it sometime next year. I love the clean URLs, clean XHTML (web forms can really spew out some nasty HTML) and the ability to create controller actions with no associated view.
I've been using Master Pages since they were released and they've been a big help. I do really dislike the way the master pages add the nasty prefixes to the control IDs. It makes for some ugly CSS. I think the MVC Framework may eliminate this problem though.
Any other killer features?
The split design/code view is pretty cool. It's not perfect yet, but it's pretty cool. Also editing in the design view now edits your css there and then.
also Dynamic Data have to be consider