Do I need to learn c# beforestarting to work with asp.net - asp.net

Just wondering if I needed to know c# before I can start working with asp.net,
can I learn them together?
what is a good starting point like a book or online tutorials.
thanks

Personally I'd start by learning C# without ASP.NET, preferrably via console applications. That way you can get to grips with the language and the core types (collections, I/O, text, primitives etc) without being hampered by all the extra stuff ASP.NET throws in your way.
There are various oddities in any "peripheral" technology (ASP.NET, WCF, WPF, WinForms etc) that it can be very confusing if you don't know the core stuff well: if something goes wrong, you can easily end up not having the faintest idea where to start finding the problem. Is it a misunderstanding about the language? The collections? The way that ASP.NET events are autowired? I'm sure you see what I mean :)
C# 3.0 in a Nutshell is a good book in terms of covering the language and the core framework. Then get a good ASP.NET book separately.

ASP.NET is a web framework - in other words it is simply a set of libraries that make creating websites easier by abstracting away all the tedious details. In order to write code to harness this framework you will need to use one of Microsoft's .NET languages (C#, VB.NET, etc.).

you can also use vb.net (visual basic). Might be beneficial if you are already familiar with it

I think you can start learning asp.net before C#. But you'll really benefit from doing both together.
http://www.learnvisualstudio.net has loads of great video-tutorials (ASP.NET, VB.NET and C#).

Yes, you can learn them both at the same time, it is often easier to start if you know C# or VB beforehand, but not a requirement at all to be successful.
There are many places to start, but 4GuysFromRolla.com is a great tutorial site. Otherwise, any of the beginning ASP.NET books would be a good starting point from a book.

C# in my opinion is the easiest of the languages supported by the Dot Net framework. I would suggest starting there.

ASP.NET leverages the multi-language capabilities of the .NET Common Language Runtime, allowing web pages to be coded in VB.NET, C#, J#, Delphi.NET, Chrome etc. This means you don't have to learn C# to use it and, even if you don't know any of those languages, you may find it easier to start with a more human readable one such as VB.NET.
In any case, I recommend the following tutorials if you do plan on learning C#:
http://msdn.microsoft.com/en-us/library/aa288436%28VS.71%29.aspx

Related

Code Syntax of ASP.Net

I have learned VB.Net with the help of some books and blogs like code project but I donot know even the basics of ASP.Net that I really want to learn.
Could you please advise me if there is any difference between the code syntax of vb.net and ASP.net or I can use the same syntax to build asp.net applications?
Thanks for your help.
If you're writing your ASP.NET server-side code in VB, then it's standard VB.NET code just like you're accustomed to. The two most popular languages for .NET are VB and C#, and you can use whichever you wish. But the fact that you're using ASP.NET doesn't change the syntax or structure of either one of them.
Basically, ASP.NET is a web framework that you'd be using to build web applications written in your language of choice (in this case, VB.NET). You'll want to know more about the framework, such as how to design your forms and make use of the web controls (and knowing HTML/CSS/JavaScript is a big help too). But the overall syntax of the VB code doesn't change.
asp.net is not a language it is a framework.
vb.net is a language which used alongside asp.net to build websites/web applications.
So in a way yes there is a difference, but the difference is that they are two different things.
It's worth noting that VS provides a somewhat watered-down interface when using VB as opposed to C#. It's really worth your time to get familiar with C#.
Microsoft's ASP.NET hub hub is a very comprehensive resource for tutorials. I'd recommend starting there, and coming back here when you have a specific question.
ASP.NET is the technology, and you can choose which language you want to use with it. C# is the most widely used Microsoft languages, but you can develop ASP.NET applications in VB.NET too.
Use VB.NET to fimiliarize yourself with ASP.NET and get a handle on how it works. Eventually, it would be a good idea to learn C#, because it's the most widely used snytax in the world. Most modern languages are rooted in the C syntax, so by learning one of them you're learning all of them. It really is the biggest bang for your buck in terms of applicable experience.

Learning Web Development starting with ASP.NET MVC

I have been working with C# for past four years at the enterprise level. Now, I have taken a decision of moving to Web side of the things. Since I am well versed with C# and WCF I naturally zeroed in on ASP.NET as I need not learn a new Programming language. Learning just the Web Framework will suffice.
I have read a lot regarding MVC, so starting out with MVC 2.
My Question is Will I face any roadblocks if I learn MVC without learning Web Forms? Keeping in mind that this is my first foray into Web Development?
Looking forward to some good suggestions.
I was in your exact same position. The only problems you may have is wrapping your head around postbacks and what tha means. Having said that, MVC2 will teach you how to write better code instead of the typical spaghetti that comes asociated with webforms.
If you're new to MVC2 I'd recommend buying Wrox Professional ASP.NET MVC2 from writer Scott Hanselman.
Learning web development these days is hard as you need to be an expert on so many different things!
You need to learn HTML/CSS/JavaScript(ie, JQuery)/Json regardless of the server side framework you are using if you are creating “rich” web applications.
I would say starting with ASP.NET MVC is not a bad option before moving onto ASP.NET Web Forms. You are likely to hit both going forward, but as ASP.NET MVC does not hide what’s going on so much, I think it may be a better start.
However if you just wish to create simple forms on the web, it is hard to beat ASP.NET Web Forms, but as soon as you wish to do something more advanced, the Web Forms complex page cycle will give you pain.
If you're looking to apply your web skills to enterprise environments, you'd probably find a lot of environments still leveraging Web Forms. Outside of that, I can't imagine it would really hurt you that much.
The bigger thing about web development is getting familiar with HTML/CSS/JavaScript(ie, JQuery). The skills learned there are applicable to either environment. You'd probably be able so switch back end frameworks rather painlessly as long as you're used to c# and all the web stuff previously mentioned.
I think it depends on what type of applications you are going to be developing. I believe web forms would be easier for you to learn with the background you already have in WCF. But it might not be worth it if the applications you are developing are better suited for MVC rather than web forms.
My recommendation would be to determine what type of applications you are going to be developing and then look at the strengths and weakness's of each and then determine which one you are going to focus on.
You most probably won't. There are some concepts that belong to the web-application environment (session, caching, etc) that are common but you'd have to learn about them anyway. They are two separate frameworks so nothing very specific about one of them could help you with the other.
You will undoubtedly run into issues when knowing a "new" way of doing things without having been brought up in the "old" way of doing things. It's unavoidable, really. I'd suggest learning the basics of WebForms code if possible, if for no other reason than to be able to trudge through it when necessary. Of course, if you find yourself in the position of having to support a WebForms application, you'll learn by doing just like anything else.
This question reminds me of my early days in .NET (which were the very early days of .NET in general) and trying to find assistance with various issues. I was an entry level developer, hitting up forums and such with questions. Everywhere I went, people weren't really adopting .NET just yet. They were all old Windows platform developers, whereas .NET was my first Windows development (I was all UNIX/Linux in school). Invariably, nearly every question I asked was answered with something suggesting that I "just use COM." Of course, I wasn't familiar with this. It was "the old way" and I was using "the new way."
It was difficult to work past that, and you'll likely face the same issue here. Basically, when people have made a career out of doing something the one single way they know how, they tend to expect everyone else to know it as well and will cling tightly to it as their bread and butter. You can be better than that, but it'll require patience :)
I assume that your development experience included Windows Forms. In terms of the transition from Windows Forms to ASP.NET WebForms, there's no doubt that would be an easier transition. Whether that would be the best transition is another question. And I believe the answer is without a doubt, no.
MVC allows you to gain an understanding of the way the Web works. Understanding GET and POST, Requests and Responses, not to mention HTML, CSS, JavaScript, et al.
I would not hesitate to recommend MVC.
I don't understand why you don't want to learn Web Forms. Learning Web Forms is just like learning abc's. You'll learn it as you go along with MVC. My suggestion is, Just go with the flow in your learning of MVC and you'll be surprise that you're already learning Web Forms.

Moving from WebForms to ASP.NET MVC

i know ASP.NET and i would like to learn and make a new project in ASP.NET MVC.
Is it easy to move from asp.net to asp.net mvc? Will the knowledge i have so far be helpful?
Im asking because i will have only few days to learn asp.net mvc and i want to know whether it's possible...
Cheers
I think you will find this questions (and its answers) very helpful.
Is it easy to move from asp.net to
asp.net mvc?
My answer to this would be a question back to you. Do you understand HTTP? Is web forms sort of magical to you, or do you have a firm grasp of what the abstraction is doing?
The reason I ask is that MVC sort of strips away a lot of the "magic" that web forms gives you in terms of treating a stateless protocol as actually having state. I tend to think of out of the box web forms development closer to classic windows forms development then normal web development. There are good and bad things about that.
What MVC is doing is bringing closer to what is actually happening in HTTP and in the end giving you more control and power over that. What you won't find in MVC is slew of drag and drop datagrid type controls, but it will make it easier to write AJAX heavy sites with common javascript libraries and clean html, as well as enable you to more easily write testable code.
Will the knowledge i have so far be helpful?
Without knowing what your "knowledge" is, it is hard to say. Obviously c# and vb are the same it's not like its a new language.
It really comes down to what type of web developer you were in asp.net forms. If you found yourself annoyed at how IDs were generated and how the html output of controls was horrible and that the framework was making it hard to do what you want then you should be fine.
If you were like I stated before, more of a drag and drop type of web forms person than MVC might be a bit challenging, but I would say its a good challenge and something that will ultimately make you a better web developer.
The only way you'll really know is if you try... There are tons of resources out there to get you started.
Hope that helps. Don't be afraid to ask questions on here as you go, there are tons of MVC devs on this site.
If you've ever used technologies like ASP classic, Coldfusion, PHP, etc. where you intersperse regular markup with server-side logic, then you will be able to pick up the "view" syntax pretty easily. The controllers are pretty simple to grasp once you get the hang of it, and the model shouldn't have to change from what you are used to. The hardest part for me to grasp when first learning ASP.NET MVC was the routing.
Like anything else, it will take some effort before you learn the "right" ways to do certain things, and you will initially be a bit less productive in the new technology. But in the end it is worth it.
Personally, I felt that ASP.NET MVC was far easier to learn than ASP.NET WebForms.
Run through the NerdDinner tutorial. It should take you about half-a-day. I think you'll find the simplicity refreshing.

What is a good asp.net (NOT MVC!) reference application for a beginner?

I'm looking for a good asp.net webforms reference application.
We have some developers with VB6 experience, but no web application experience. I'd like to provide them with a couple of example apps that make use of a few simple forms, some user controls, db access, etc. An application that made use of a separate project for classes would be a nice bonus.
There seem to be a lot of very simple examples/tutorials for given features, but I can't find a good reference app that covers all of the above-mentioned topics.
Any suggestions?
I would recommend the ASP.NET starter kits here on the asp.net site. They are pretty diverse. My suggestion would be to actually try the hosted versions until you find one that suits the features you're trying to demonstrate. BeerHouse is a great start.
This one looks pretty interesting. It's a shameless plug for the Infragistics controls, but it looks like they're doing some non-trivial things:
The reference application shows the
use of web services, client side java
scripting, XML data binding and other
real world code samples.
http://devcenter.infragistics.com/RefApps/Expense/Expense.aspx
http://www.asp.net/community/projects/
Starter kits are a good place to look...

Classic ASP development

I work with a actively developed production web application that is written entirely
in Classic ASP. Like most classic asp applications it is a mess full of spaghetti code. So I am beginning to break pieces into simple VB classes to gain some basic encapsulation benefits.
While creating the classes I feel conflicted that a higher level language to do so. Are there any recommendations on how this could be done? I have two thoughts:
COM Objects and Web services. I'm leaning towards the web service route but would greatly appreciate any suggestions on how to best encapsulate the business logic of a Classic ASP system into a higher level language.
What do you recommend?
As a start I recommend you read about MVC.
Then you can switch to a framework that support such a concept, such as the ASP.NET MVC and got even further by using a SoC tools, like Castle Windsor, NHibernate, etc.
If you don't want to embark on such a OMG start from scratch journey, then a web service will be the preferred solution for encapsulating the business logic. (following the model-view design pattern).
COM objects will be a bad solution for this task. They are not intended for web applications or logic management.
You might be interested in using ajaxed which has been built to support legacy classic asp apps.
I attempted to "simplify" a classic ASP site of mine a few months ago, primarily using COM objects. I didn't find the experience particularly satisfactory. I didn't have much time to devote to the project and I never got the development environment to gel properly so debugging etc was an ongoing pain. Writing the objects in C# was straight-forward but integrating them on the production server was a hassle.
In the end the I just cleaned up the data-access layer and related classes within Classic ASP itself. This definitely gave the best ROI in terms of time spent, etc.
I sometimes feel as if I ought to have a go at replacing some of the site with COM objects or similar, but I struggle to justify to myself why that'd be a good idea.
Anyway, regardless of the approach you take I'd suggest you ensure that your development process is as seamless as you can make it. This is not necessarily straight-forward when at least half of it will be classic ASP based.

Resources