Hey OP - I know this is the worst kind of advice because you didn't ask for it, but I think you're going down a dangerous path here. It looks like you're implementing your own cookie based authentication system and storing sensitive information in plain text in the cookie. This is dangerous because it's trivial for a user to manipulate the cookie and do nasty things like potentially escalate their privileges in the application.
I'd recommend you take a look at ASP.NET Identity or [Forms Authentication](https://msdn.microsoft.com/en-us/library/ff398049(v=vs.100\).aspx) if you're looking to implement authentication. Security is worth doing right the first time.
edit: fix URL
If you are already familiar with .NET, you might want to consider ASP.NET MVC. It's a great framework for building web applications on the .NET platform. There are lots of great tutorials on the official ASP.NET site: http://www.asp.net/mvc
Also, here's some free MVC training videos from pluralsight: http://www.asp.net/mvc/pluralsight
I would AVOID learning WebForms and stick with ASP.NET MVC.
To answer you questions, Web Development and websites are comprised of two parts client side and server side.
Client side is always the same, HTML, javaScript and CSS. But server side you can really use any technology including python, ruby, java, .NET and much more.
Same with IDE's. If you like Visual Studio, you can use it to build ASP.NET websites.
You can host on the database either on a hosting service or on a cloud provider like Amazon or Windows Azure.
The web server that hosts the web app depends on which technology you picked. The most popular ones are apache, nginx and IIS (windows only, but works great with .NET).
Since you are familiar with Java, here is how things match up on the .NET side:
CLR = JVM
.NET Framework = Java Runtime Environment
ASP.NET, ASP.NET MVC, etc. = Play, Grails, Spring MVC, etc.
C#, F# and VB.NET = Java, Scala, Clojure, etc.
If you are getting into a job that requires ASP.NET, you will basically need to know the language (C# or VB.NET most likely) and the web framework (ASP.NET or ASP.NET MVC) at minimum. You will need to know about the .NET Framework to a certain extent too. For someone familiar with Java (or another OO language), learning C# won't be too difficult. A week or two at most should be enough. It takes longer to learn the frameworks IMO. Since you are new to Java, it might take a little bit longer for you but there are a ton of resources online. Here are a few of my go to links:
http://channel9.msdn.com/Series/C-Sharp-Fundamentals-Development-for-Absolute-Beginners
http://tekpub.com/blogs/tekpub-free-bin/tagged/asp-net-mvc-concepts
http://www.asp.net/get-started
Search through this subreddit and /r/csharp. There have been other threads posted that have more information/recommendations. Stack Overflow is also a good resource.
Ok first. The model isn't what the controller uses, a controller can use a model, but that does not define what a model is.
A model is a set of classes representing the data and business logic of your application.
A request consists of a URL, headers, and data. What a response consists of is defined by how your application reacts to the request, it can be literally anything, but is usually HTML rendered by your views.
An API responds with just data, like JSON or XML instead of HTML views.
Before you go to a tutorial about web APIs specifically, it sounds like you need to start at the very beginning of what web applications are and how MVC works.
You can start here http://www.asp.net/learn
It's pretty hidden at the moment, as AFAIK the team's main focus has been on ASP.NET 5. You need to have Visual Studio 2015 (the free community version is fine) and install ASP.NET 5 as it includes all the latest tooling. Then you go to Templates → Visual C# → Web → Console Application (Package). Yes, it's hiding under "Web" for some reason, but the resulting project doesn't have any web/ASP.NET dependencies at all. More docs at http://docs.asp.net/en/latest/dnx/console.html
You can create a shared library in a similar way.
The big difference between .NET and PHP is the forced OOP. That might be the thing that might annoy you at first, but you should really just try to accept it and use it to your advantage. It can be quite overwhelming getting into ASP.NET at first, but once you get under its skin, you will question why you even bothered with PHP in the first place. The performance of ASP.NET is excellent, and the database support, level of abstraction and tooling is vastly superior. The added bonus of doing ASP.NET is that you're using a language that isn't strictly web-only; once you've learned C# you can apply that language to basically anything you want (even for performance-critical tasks and games).
ASP.NET MVC is pretty straight forward to get into; just start up a new Web Project and let the wizard create a starting template for you (it will contain basic html, controls and models which you can explore). There are tons of videos, tutorials and introductory documents on http://www.asp.net/.
> So I have been thinking about the Microsoft stack in general. Now, every place I have worked at has been a LAMP environment and there has been this stigma attached to Microsoft development that I have a hard time shaking. They always referred to Microsoft environments as high class corporate suit environments.
One thing that rarely gets disclosed is how much easier it is to work with the Microsoft stack in general. Things are actually designed to work together, they're not hacked together with superglue and duct-tape which is more often the case in Linux environments (shell scripts taking output from a shell command, running it through a regex parser and then sends that information in as parameters to another program.. Just the thought of that type of pipeline makes me feel nervous)
It sounds like you're wanting to create a restful endpoint to handle communication with your database. Using something like ASP.NET Web API would be the simplest route and there's plenty of documentation out there to get you going.
http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api
Just to make a suggestion, if this is a desktop application that you're distributing to other people, you probably don't want to have them connect directly to your database. Typically for client applications, you'd build a trusted middle layer (the backend), that handles fetching the data. Your desktop application would then make an API request to yourapp.com/api/products (or whatever), and your backend would do the appropriate permission checks, queries, etc. Otherwise, as soon as someone finds those hardcoded database credentials in your software, they're going to have full access to your database to do whatever they want.
You could use ASP.NET's WebAPI on your shared hosting, or I think there's services out there that host databases + rest api's for you for relatively cheap. Maybe something like Firebase.
If it's just an app for yourself, and you want to connect remotely, you could try something like Azure SQL. It's a cloud hosted database, accessible from anywhere (just add the IP to the Azure firewall), with almost no management needed. The basic tier is only $5 a month.
Ok. I am going to recommend a slightly different path for you.
First, read through this tutorial: http://www.asp.net/mvc/tutorials/mvc-music-store
Then consider doing your project as an MVC web app with Entity Framework. I think you might find it a lot easier, and you'll end up with an application that isn't tied to the desktop.
You're comparing apples to oranges. Generics and MVC are two completed different things. MVC (in the .NET sense) refers to ASP.NET MVC which is a web framework. Generics instead is a language feature. Generics (which are awesome) allow you to create objects and methods that are type independent. You specify a type when declare/using the item. This is really cool because it promotes code reuse and makes your code base cleaner. Understanding generics is tough, but the payoff is huge. Now because generics is a language feature, you can use generics in pretty much anything .NET as long as you are on .NET 2.0 or higher. So ASP.NET Webforms, ASP.NET MVC, Windows phone, you can use Generics with all this stuff.
In terms of learning MVC, everything you need to learn it is here http://www.asp.net/mvc
I'm a C# developer with around 4 years commercial experience. Absolutely NOT an expert but I can share my experiences and things I have picked up on the job.
If you are already comfortable writing in C#, I'd strongly recommend sticking with it unless you have a particular desire to pursue another language. Not sure what country you are in, but where I live (UK, south), C# developers are in very high demand.
I can give you examples of things I've had to learn on the job but by no means take this as gospel. Also this is extremely generalized.
MVC is an architectural pattern and is language agnostic. It is very commonly used in ASP.NET. I would recommend learning this along with Web API.
To clarify, C# is a language, ASP.NET is a web focused application framework which you would utilize if you were to write a web application in C#.
A good starting point would be this video series which will walk you through setting up an MVC website from scratch - http://www.asp.net/mvc/pluralsight Perhaps you could apply this to your own personal website which could host your CV, code examples, links to github / other projects, etc.
Give me a shout if you have any more questions, hope this helps.
SQL Server LocalDB is good for getting a DB up quick and easy.
> LocalDB is a lightweight version of the SQL Server Express Database Engine that starts on demand and runs in user mode. LocalDB runs in a special execution mode of SQL Server Express that enables you to work with databases as .mdf files. Typically, LocalDB database files are kept in the App_Data folder of a web project.
More info here.
Tutorial here.
For people confused between: SQL Express v LocalDB v SQL Compact Edition.
Start here: http://www.asp.net/aspnet/samples/aspnet-mvc
Between the samples you find and the links to forums and MSDN based sources you should find plenty to get you started. You would also do well to read up on the MVC pattern in general
I'd say yes, but not directly. A lot of people are turning to a kickass library lead by Damien Edwards called SignalR
SignalR uses Web Sockets, and falls back to other compatible techniques for older clients.
It's awesome, use it. :)
I learnt using two excellent resources:
Neither uses the current version of MVC, but they will give you an intuitive grasp of MVC architecture, which is the hard part. Also they are fairly concise. You can work through both in one weekend.
After that, go through the videos the asp.net site, particularly those on the Razor view engine, to get up to speed on recent developments.
Also, consider learning Entity Framework and Linq, if you haven't worked with them already, since these technologies work in tandem with MVC.
I've never worked with it myself, but if you're proficient with C# you may want to check out Microsoft's ASP.NET framework. I did a quick search and apparently Dell's website is built using it. Microsoft has relatively recently become very good at providing free training courses through their website on how to use their various products and technologies. Here's the one for ASP.NET.
Since you're using ASP.NET MVC, you could look into SignalR: http://www.asp.net/signalr
> ASP.NET SignalR is a new library for ASP.NET developers that makes developing real-time web functionality easy. SignalR allows bi-directional communication between server and client. Servers can now push content to connected clients instantly as it becomes available. SignalR supports Web Sockets, and falls back to other compatible techniques for older browsers. SignalR includes APIs for connection management (for instance, connect and disconnect events), grouping connections, and authorization.
Never really understood the need for tech blogs as a reference. They're usually just wordier versions of stackoverflow answers or watered down technical references.
In any event, there's a 'So you know aspx' quick reference, but the first and last guide you really need is [the msdn razor guide](http://www.asp.net/web-pages/overview/getting-started/introducing-razor-syntax-(c\)).
pluralsight has some good resources. There's a 10 day free trial, so check it out. Definitely download visual studio and build a web app of sorts, as suggested by /u/trout_fucker, but the videos on there are what got me started. Understanding MVC is a big part of ASP .NET. This tutorial (http://www.asp.net/mvc/overview/getting-started/introduction/getting-started) gives a pretty good basic overview/demonstration of MVC. Make sure to actually build the app yourself though
If I was going to build something today, I'd build on OWIN (katana). http://www.asp.net/aspnet/overview/owin-and-katana. Provides a nice abstraction that should allow minimum rework when vNext is released.
Webforms sucks, yeah. Try looking into ASP.NET MVC or if you're not too familiar with the MVC model, try ASP.NET Web Pages (http://www.asp.net/web-pages). You might see some of the intro tutorials using WebMatrix, but I highly recommend going straight to Visual Studio, because WM sucks.
I used ASP.NET WP2 for a medium-sized internal project (also MSSQL backend) and it worked very well. The web helpers are a huge time-saver. Additionally, once you master the WebPages and Razor syntax, ASP.NET MVC will make more sense to you, and that's a really powerful and versatile development platform.
ASP.NET MVC uses routing which means that the address is really just pointing to a controller (maybe named HomeController?). Check the global.asax file in the root of the project. Edit: Meant global.asax, not .ascx
http://www.asp.net/get-started/websites
my suggestion would just be to dive into the deep end and start looking at asp.net mvc. it'll take you a bit longer to figure things out, but i don't think i've worked on an asp.net site that wasn't mvc in the past 5 years or so.
Depends what language(s) you know. I know C#(similar to Java, except more features and more robust features), so here's my summary:
Nearest MS equivalent is Web Api 2 for creating a web service only project. Create an empty web project and check off the include web api core option and you get a very stripped down project.
http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api
I will try to get you on the right track without going too in-depth. First, the URL you need to hit is http://www.reddit.com/.json that is going to return JSON (read up on that) which you will need to deserialize into an object(s) using C# (there are libraries that do that for you). Once you get the JSON converted to object(s) you should be able to handle it from there.
Bonus: Download Postman for Chrome and user it to get better formatted JSON so it is easier to structure your objects.
Super Mega Bonus: Here is a nice tutorial on how to consume JSON using C# and visual studio.
No. Storing passwords in plain text is bad, and creator should feel bad.
Take a look at http://www.asp.net/identity if you need authentication in your project. There is almost never a case where you would need to roll your own authentication.
YES. OH GOD YES. ASP.NET MVC is the accepted best route for new web application projects over webforms.
The article linked has absolutely zero logic implemented, its all prebaked, with little detail into how things work. He doesn't even show you how to add a controller method. Not to bash this blog, but a more comprehensive resource of tutorials would be http://www.asp.net/mvc/tutorials/mvc-5. Granted, the linked article is simply the first part and is theory heavy, so it might pick up in the next part.
MVC can get incredibly deep. You can add new web actions (called controller actions) that can do whatever you want, return any page, its a full fledged web application framework. This article does absolutely zero justice to the system, aside from how easy it is to start a new project (which you only do once in a while).
I use ASP.NET MVC with a C# backend, and add an extra MVVM, BLL and DAL layer to keep concerns seperate. I even customized how the user session is handled so I can have it hold extra data (by default only the user name is held). But i'll have to revisit my custom implementation with Identity claim based authorization is implemented into my project (a newer, more comprehensive security system).
It is worth just looking up some tutorials on Asp.net MVC, there are plenty.
But the basics are it is broken down into a couple of sections usually, models/controllers/views which are normally directories in a mvc project when you make anew one.
So a request comes in, tries to match the URL to a route which are normally set up in the global.ascx which will figure out what controller it wants then usually action is next in the URL, the action then will decide what view it will use, by default it tries to match a view to the name of the action, so /views/Home/index.aspx will be used, and the controller would be in controllers/HomeController.cs and in there is a method called index. Sounds like they have an controller/action of Home/index mapped to Home.aspx.
But then again the tutorials out there can explain it better then I can in a wall of text, try your start here http://www.asp.net/mvc/tutorials
If you are familiar with VB and Java, you shouldn't have a problem learning ASP.NET MVC. Take a look at the learning resources on this site: http://www.asp.net/mvc
Edit: You can download a Free IDE to write and test all your code.
The asp.net site has a number of tutorials plus a link to a some free Pluralsight videos:
If you prefer books, there are two that I know of - one by Jon Galloway (who does the Microsoft Virtual Academy videos) and one by Adam Freeman. After watching the Microsoft Virtual Academy videos and reading the Amazon reviews, I decided to go with Galloway's book. Unfortunately, it's really not that good.
Galloway's book starts off feeling like a walkthrough, then the walkthrough abruptly stops. The book is written by multiple authors, and it doesn't have a cohesive feel. (Wrox has a history of publishing written by committee books.) There are number of other things I didn't like about it. DB migrations (model / database changes) are mentioned as an aside in the Single Page Applications chapter, which tries to give a lightweight AngularJS tutorial. The chapter(s) by Brad Wilson seemed to be aimed at developers coming to MVC from Webforms (which I am not). And, there is little coverage of dependency injection, unit testing and deployment.
I'm now going through the Freeman book, and from what I can tell so far, I wish I bought it in the first place.
That's a tough one in that many frameworks kind of do similar things, you can group things by functionality though:
NodeJS Node actually isn't web specific. It's just a way to run javascript code server side. This can be for running a web framework or just executing shell commands.
Server Side Web Frameworks
These execute code on the server and handle db access/user registrations. You have a few options here.
Ruby on Rails . Very popular and easy to set up, but you have to learn Ruby.
Express. Very popular node js web framework. Since it's node, javascript is the main language here.
Laravel. MVC web framework built on Php
ASP.NET MVC - MVC framework using C#. http://www.asp.net/mvc
Front End Frameworks
Angular JS: Very popular MVC framework for the browser. Meaning it's all client side and helps organize the javascript that gets served in the browser.
React: Another great front end framework for building rich applications. It is maintained by facebook and they use it for their site.
Browserfy: Front end dependency manager. It's about having a neat way to namespace your javascript code (inthe browser). IT's not for UI work, just importing in libraries.
Hammer: Touch gesture library for the front end.
Build Tools
Grunt/Gulp - These are both build time task runners that you use when developing. They let you automate things like minifying javascript or running unit tests on the fly. Grunt and gulp are similar in how they work, just implementation differences. Gulp is considered newer and faster. Personally I find gulp easier.
Grade - Have not used it, but it looks like a neat build system to offer CI.
Composer - Also have no used it, but it looks like dependency mangement for Php, so I'm lumping it under build tools.
Personally I like Node/Express and ASP.NET MVC for my projects. On the front end I use Angular. For build I use gulp.
>However, writing additional code to implement these patterns is not always the best choice for applications that use EF, for several reasons: > > * The EF context class itself insulates your code from data-store-specific code. > * The EF context class can act as a unit-of-work class for database updates that you do using EF. > * Features introduced in Entity Framework 6 make it easier to implement TDD without writing repository code.
I work for Premier Support in Microsoft, teaching workshops on Azure and MVC. This is the tutorial series on which most of my labs are based.
(Disclaimer, I do not officially represent Microsoft on Reddit.)
If you're starting a new ASP.NET project I'll strongly recommend a combination of ASP.NET MVC and Web API. vNext is just the code name of the next version but there will always be a next version so just start with what's available now.
http://www.asp.net/mvc Check out the videos on the right.
MVC and Web API will be merged in vNext because after all, the only significant difference between the two of them is that one returns rendered templates and the other one returns JSON data.
Single Page Apps are what you create when you don't want your web pages to refresh every time that you click on a button. (Think of Gmail.) In the .NET world they're usually comprised of Web API controllers that work in conjunction with JavaScript, presumably with the help of client side frameworks like AngularJS. Worry about Single Page Apps after you've learned ASP.NET MVC because even though SPAs are great they're not essential and because working with them involves mastering JavaScript and at least one client side JavaScript framework.
Web Forms I can't recommend unless you'd like to mimic the drag and drop style of development of WinForms. Yes, it's very easy to get started with Web Forms but your development process will only grow increasingly complex as you try to implement more complicated things because you can only stretch the heavy Web Forms abstraction so far before it starts to break.
Web Pages you don't have to worry about. It's a minimalist framework that's not meant to be used professionally even though some great technologies like Razor views were born out of it.
The ASP.NET vNext platform is going to be awesome. I'm already running some MVC5 applications on Linux via mod_mono, and running them without relying on apache/nginx will be even better.
Sort of... maybe... kind of...
The default installation of Git for Windows includes Git Bash which is basically a port of the minimum amount of Bash that Git requires in order for it to work. It works but it feels very un-Windows-like.
If you download Git from GitHub, however, then you also get Posh Git which is the PowerShell extension that I mentioned before. It works but it feels very un-Unix-like.
You pick the one you like the best (and then deal with the consequences ;-) ).
But regardless of what distribution you download you should keep in mind that Git is Unix first and Windows second so the Windows port will always be a version behind. That's not usually a problem and so far I haven't had issues with that but if you need bleeding edge Git features on Windows then you're pretty much toast.
And now for a bit of history!
Some say that the recent adoption of open source in Microsoft's developer community started out with ASP.NET MVC, which is a web framework that was inspired by communities like ALT.NET, which is a movement that encourages developers who use Microsoft technologies to look outside of Microsoft. Phil Haack, a Microsoft employee and avid blogger who worked with ASP.NET MVC left Microsoft to work for GitHub. So, it makes sense for Git to have gained traction in the Windows developer community and it makes sense for GitHub to distribute a Git package that makes Git feel at home (kind of) on Windows.
I think you're grossly misinformed and you're a bit heavy handed on reprimanding "the DotNet Community" because of your ignorance.
MSDN has a ton of free content.
http://www.asp.net/mvc/tutorials/mvc-5/introduction/getting-started
Microsoft even has free video training.
There is a ton of great content (free) out there...you just have to know where to look! (Or Google). Instead of coming out and demanding free content (and doing it in a condescending way), why not ask the community for links to free references. You'll catch more flies with honey, than you will with vinegar.
The (previously external) AntiXSS library is included in .Net 4.5 in the following namespace:
System.Web.Security.AntiXss
It's not the default (I presume due to some backwards compat. reasons). Further reading (and how to make it the default):
http://www.asp.net/vnext/overview/aspnet/whats-new#_Toc318097382
Scrap your code and just use jQuery validation. Not only is it an amazing plugin but it's so popular that it's hosted on microsoft's cdn:
http://www.asp.net/ajaxlibrary/cdn.ashx#jQuery_Validation_Releases_on_the_CDN_2
Edit: Just so you know how easy it is... All you would need to do is:
Remove your jquery code.
Add the script to your page.
Add the class 'required' to the 3 inputs you have. Also add the class 'email' to the email input.
Then add > $(document).ready( function() { > $('yourForm').validate(); > });
I am a huge proponent of ASP.NET MVC. Luckily they also have some pretty good tutorials at the mvc site. The main reason I back .NET is I fully believe Visual Studio is the best code editor available. I'm personally more productive in .NET than any other language and I don't think I'm the only one.
.NET isn't going away. In windows 8 you will have basically have several modes in which you can develop desktop apps, one uses silverlight and looks a lot like .NET. However, web applications will still be developed in .NET and the same for mobile applications. Web application development is very popular among large enterprise applications and I'd say it's more popular than SAP.
Get a subscription here and start watching videos but .NET is a mature framework that you can use for anything from mobile to web to desktop. http://www.pluralsight-training.net/microsoft/
I'd also recommend you checkout ASP.NET MVC which lets you use the .NET framework to build MVC style web apps. it's really cool. http://www.asp.net/mvc
Why are you using ASP? ASP was deprecated many years ago. Its successor, ASP.NET, has been in the market for almost 10 years. Don't waste your time with ASP. You might as well learn PHP 3. And don't waste your time learning Microsoft technologies at w3.
Try these links instead:
There are videos and tutorials and free tools and everything else that you might need at those links. I highly recommend MVC instead of WebForms. They're both variants of ASP.NET.
And if somebody recommends using an Access database as a back end stop taking advice from that person. And use C# instead of VB.NET if you can.
ASP.NET is .NET on the web.
There are two official versions of it, WebForms and MVC. I will recommend MVC.
You can learn about it with the following links:
You can start with the Pluralsight videos at the left of those links.
They can live in the same solution. Here's a tutorial on doing just that http://www.asp.net/aspnet/overview/whats-new-in-visual-studio-2013/one-aspnet-integrating-aspnet-web-forms-mvc-and-web-api
The trick is to figure out which urls will be handled by MVC and which by webforms. When we did this at work we realized that you can't put webforms in the mvc folder, so either keep webforms in the root (not ideal) or create a "webforms" folder and move them there then use url re-write to forward requests to /whatever.aspx to become /webforms/whatever.aspx.
I've done this a few times with different sites and little issues.
Some of the things to consider:
If you use Master pages in webforms (which I hope you do) you can't reference the master page directly in mvc. So most people end up with a master page and an mvc layout page (top level container). I would try to push as much as you can to external css files and share those. State becomes weird here also (like in terms of nav bars and which tab is active).
Session information and temp data. The session object is available to both, but mvc's tempdata is shortlived.
Come up with a migration strategy, which parts of the site to migrate. Which you can leave in Webforms for now (or forever).
Note you can't mix aspnet core with webforms, but you can mix aspnet mvc on the full .net framework.
It's important to convey that both webforms and aspnet mvc (in the current .net framework) are just ui libraries on top of the same asp.net pipeline. They both share the same internals and depend on system.web.
Yep - ASP.Net MVC. IMHO, the only way that you should be doing new development (if you're sticking strictly within the MS stack).
Oh, and make sure you're actually targetting Dot Net 4.5.2 or 4.6, as support for v4.0 ends in January.
I'd use ASP.NET MVC5 using Entity Framework. It has built in templated code for authentication and user accounts. You want to run this on Windows and IIS with MSSQL (in my opinion). Once you have a good grasp on C#, start here - http://www.asp.net/mvc/overview/getting-started/introduction/getting-started
When you're getting started you'd like want to use a Javascript framework for the visualisations and Signal-R for the chat.
Practice? Make stuff. Any stuff.
A good place to start is by creating your own blog platform. Start with a way to display a blog post from a database, then expand so that you can create new posts, edit existing ones, comment on posts, etc.
If you're looking for lessons and not practice (your post is unclear), the MSDN has strong documentation. Presumably you're using ASP.NET, in which case you'd want to start here for that (this is ASP.NET MVC -- be sure to check that this is what you'll be using; if you're not sure what to use, go with it).
I'd try finding some stuff on PluralSight and Microsoft's Channel 9. I just started working with EF and ASP.NET this week and it took me a while to get the hang of it, but I feel comfortable now.
The course is free on ASP.NET:
Started with the C# webstack myself. Very happy with my capabilities. I can confidently say there is nothing I can not build with it. More recently, I have applied my C# knowledge to making games (Unity3d). Its nice being able to apply the same logic client side and server side.
Why do you think Web Forms are going away? Microsoft indicates on their ASP.NET 5 overview page that Web Forms will continue to be supported.
http://www.asp.net/vnext/overview/aspnet-vnext/aspnet-5-overview#webforms
I just browsed over to http://www.asp.net/vnext and the ultimate guide and setting everything up from scratch guides were pretty good.
Its a fairly broad topic, is there a aspect you want to focus on or are you interested in every aspect of the stack?
Things like OWIN, NuGet, Dependency Injection, Front side compilation, portable class libraries, testability, etc. form the core and understanding these concepts will help when you look at the vNext stack and its motivations and design.
I would suggest migrating to the latest SignalR (not using 1.x). Then give the documentation a read: http://www.asp.net/signalr/overview/signalr-20/hubs-api/mapping-users-to-connections
That will show you how to consistently map users to connections and the various ways to handle that in multiple server scenarios.
EF is pretty fucking sweet. even when you use fluent nhibernate seems to be more of a pain in the ass to throw together.
That link is super cool, discusses code first & db first and shows how to implement repository and unit of work patterns.
I once created a simple forum in .net mvc, and I faced the same problem. There are no "off the shelf" solutions for a simple, no-registration forum. They are all "overkill". You'll just have to whip one up yourself :-)
For more information on asp.net, check out the tutorials on http://www.asp.net/. They are very very good.
There are two main variants of ASP.NET: WebForms and MVC. I always recommend MVC.
One of the quickest ways to learn it is by using the resources available at the asp.net website itself.
The free plural sight videos on the left of those websites are a good intro. They also cover jQuery.
I never recommend linking to w3schools. Its quality and accuracy is very variable. The article that you linked to is not only semi obsolete, but also partially incorrect. Microsoft has some great resources for learning ASP.NET. You should link to those instead.
I am not going to read your code right now because I have a headache and WebForms makes it worse, but I am going to give you some advice.
You're using old techniques. You should switch to new techniques before you grow fond of what you're doing. Things have gotten a lot better. Ditch WebForms, which is what you're using, and switch to MVC. Ditch Readers, commands, etc. and switch to EF Code First. You will thank me later.
http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-code-first-walkthrough.aspx
And if you're going to use SQL please use prepared statements. Don't just concatenate SQL strings like that. That is an SQL injection attack waiting to happen.
I will try to read your code later anyway.
VB.Net is the language. The web platform is asp.net. Further, there are several way you can build web pages using asp.net, including "web forms" and "mvc". Since you mentioned master pages and aspx, then you're dealing with web forms.
Unfortunately, that's a bit of an older combination, so don't expect to find too many recently published materials on this. But a good place to start is http://www.asp.net/web-forms.
Or, for a book, check out murachs book on asp.net: https://www.murach.com/shop-books/visual-basic-programming-books/murach-s-asp_net-4_5-web-programming-with-vb-2012-detail
(I like the murach books, though of course the other IT publishers will have books on asp.net as well.)
Take a look at ASP.NET MVC. It's C# and a pretty modern framework http://www.asp.net/mvc
There's also asp.net core, which is x-platform asp.net mvc and runs on windows,mac and linux. It's REALLY fast.
Edit: ASP.NET Core docs - https://docs.asp.net/en/latest/
Facebook is written in PHP rather than C#, and the code to show content is considerably more sophisticated than a single query, but in short yes: to build a website with database driven content, your server-side code will fetch data from a database, loop over the records, use a template of some sort to format the records into stream of HTML, write stream out to the HttpResponse.
If you are already familiar with C#, I encourage you to have a look at the Getting Started with ASP.NET MVC tutorial which will walk you through the process of creating a website. You will readily be able to see the HTML template which is processed on the server-side to generate the HTML rendered out to the browser.
Just a quick answer: Maybe take a look at Example from <http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-a-more-complex-data-model-for-an-asp-net-mvc-application>. I would "connect" the Enrollments directly to the courses and for the prerequisite simple "ask" if the student has a grade for the relevant course(s). Hope it helps.
there are probably hundreds, but... they are pretty tailored for the deployment type. are you publishing local? MVC4/5/6 (and all code first?)
I mean, the default one pretty much covers it all:
http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/deploying-to-iis
I wouldn't bother. Go to your local library and check out a book on it or buy one from Amazon. Microsoft also has tutorials on asp.net, they go over MVC, web services and azure. In a way, I trust Microsoft more because they have financial incentive to make you happy with their product.
Sounds like what they are saying is that you should use asp.net mvc (which doesn't have <asp:, that's a webforms construct).
To be clear there are multiple flavors of asp.net, it doesn't all use <asp: style tags, only webforms. Today you have ASP.NET WebForms and ASP.NET MVC.
Start here with MVC. http://www.asp.net/mvc
Since you are on the Windows platform I would recommend using ASP.Net MVC and write your code in C# or VB.Net (since you already have VB skills).
Using ASP.Net MVC and Entity Framework makes it very easy to write intranet based Web applications that connect to SQL Server.
Also the are umpteen tutorials on that subject available on the Web so it is fairly easy to learn.
Here is just one such example: http://www.asp.net/mvc
Unless there's some reason you want to do it by hand, these things are best left to a framework like ASP.NET MVC if you're building a website.
You'll want to create an ApiController so you can expose a public POST method
You can then use this method to call existing functionality
Remember that you'll need to add some authentication to this as it will be public and you don't want anyone to be able to call it
Take a look here http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api
ASP.Net Identity + Claims defining what users have access to. I have used Dapper with Identity before, it's pretty easy. You need to implement a custom IUserStore (+ any additional stores you want) for basic user CRUD/lookups. "Stores" for identity are essentially repositories that the identity user manager uses to persist and lookup user information.
What you 'need' to test can a bit subjective. If my controllers contain any logic (any IF's, Switches, etc), I will test that the action I expect back is returned.
Typically you want your controllers to be skinny, and pull all of your logic out into another project. This will allow you to test your specific business logic. Business logic is (obviously) the most important thing to write tests for. If a team member is working on something and accidentally breaks the expected outcomes of a method, a good test will let him know.
Since you mentioned razor specifically, you wouldn't test your actual views (.cshtml files). At most you would test for values in your model or view-model being returned from the controller, if you have a need for it.
http://www.asp.net/mvc/overview/older-versions
I cant remember if 2012 allows it, but in 2013+ at least, when you create a new project, there is an option to create a test project along with it.
I'd also advise grabbing NUnit from nuget as your testing framework.
As for general good practice for writing testable code, you should look up SOLID.
I gotta say in this case: the http://www.asp.net website is probably your best friend.
They have full tutorials with example code and all making a full working application. http://www.asp.net/mvc
This is obviously now all geared toward teaching you ASP.NET 5 (MVC 6/EF 7) which just now hit RC1-Final, RC2 soon and should be finalized early '16.
For the current version, just gotta dig around. Here's my favorite tutorial on that site as it goes through fully using EF code first approach and building a slightly more complex data model (with associated entities, etc) than most basic tutorials.
There's the tutorial just above this one in case this one starts a bit too quick for you.
Hope this helps :)
Exactly, WordPress is the largest, most supported and documented CMS. The guy who keeps down voting me is sending you down a long and confusing path, which isn't the right way when you have a client waiting for a product.
You don't have to learn drupal, you don't even have to learn PHP and if I were you I wouldn't learn either. Personally, I loath PHP, its cryptic....as in extremely hard to read...too many symbols, keywords are dumb etc etc. I also think the feature set of the language is archaic. BUT there are a lot of CMS's and websites driven by PHP.
It really depends what your aspirations are as a developer, do you want to do websites? Or do you want to do web applications with the possibility of moving into enterprise level applications. I think an easy language to start out with is Python. But if you want to be a software developer, like this is your career path, I would learn C# or Java. My preference is C#/ASP.NET.....you can build websites with it but with those languages you can pretty much build anything. Also for C# and Java....the number of jobs is endless.
Either way... Learn the language itself first. Not something written in it. If you want to learn PHP, learn PHP....do PHP tutorials and classes.....then move to a framework like Cake. Then learn a CMS like drupal. Take it one step at a time.
If you want to learn PHP or Python....this is a great site
If you want to learn C#/.NET look here
I don't know Java so I can't point you in the direction of a tutorial for that.
Is there some reason you wouldn't just use the ErrorMessage parameter on the DataAttributes? Generally speaking if the framework doesn't expose something, it's because using that information breaches some elementary design practice.
You can see an example of this in action in the basic MVC tutorial, with the DataAttribute
[Range(0.01, 100.00, ErrorMessage = "Price must be between 0.01 and 100.00")]
If you decide you absolutely must breach that abstraction, you may as well use the tools for abstraction breaching provided like using reflection with typeof() or string manipulation.
Gridview is part of webforms. This is seen as a bad way to write web applications and nearly all new .net web developments use the MVC framework.
It may seem a bit more work than binding a control that does a lot for you, but it means you understand what is going on when you want to do things differently than the control will let you.
Two things I would advise:
1.) Try to get into the database as soon as you can. The sugar that's on the front end is interesting, however job prospects require that you can build applications, which in most cases require data manipulation of some kind.
2.) Try to work in an IDE, with the eventual intention to learn the ins and outs of source control. Every job worth its salt has some sort of version control (and the ones that don't will probably try to low ball you).
Microsoft is a dirty word in these parts, but a good (and free!) IDE is Visual Studio. And Microsoft has built a pretty open platform around ASP MVC.
I'm going to assume you have a windows machine, so getting both of those running is a snap.
Here's a good starter tutorial to get you going on ASP MVC: http://www.asp.net/mvc/overview/getting-started/introduction/getting-started
Getting the software installed to start developing is as easy as installing Adobe Photoshop.
Now, if you have a Mac, one way to go is to get MAMP installed (which is an environment) and then start hacking away using a text editor (like Sublime). Php and MySQL maintenance is highly sought after in the city.
Alternatively, you can get going on a framework like Django or Ruby on Rails. The job prospects are...spread out.
If you've got a windows machine, let me know and I can guide you through some stuff. If you're going Mac or Linux, there's others on the thread that'll probably be more helpful.
> (since I know and am comfortabe in C#) learn ASP.NET instead?
Hell yes. You should have said that in your OP. Try to get a book on Asp.net MVC or check out the information on that site.
ASP.NET is the web side of .NET. Everything you need to know about it you can find here. http://www.asp.net/
It is about as popular and is found in the same environments as JAVA. Usually large corporations.
>I know Python and Java pretty well so I don't imagine I'll have too huge of a learning curve with C# or any of the other languages Visual Studio uses.
You shouldn't have a problem, but do keep in mind that although C# looks like Java, there are some major differences in terms of base types and certain features. For example Lambdas are pretty to Java, but a standard in C#. Not to mention C#'s async/await and TPL infrastructure is interesting. These are advanced topics for later, but just saying that you should set yourself up to expect that and not just learn C#'s synatx.
In adition, the .NET eco-system is very different from Java and Python and learning how things are done in this world (libraries, conventions, etc) is just as important.
As for what types of projects, you can really build anything from web apps to mobile apps to desktop apps.
If you're interested in Web. The official asp.net site has some great tutorials http://www.asp.net/mvc/overview/getting-started/introduction/getting-started http://www.asp.net/mvc/overview/getting-started
The official asp.net site has a ton of great tutorials, videos and articles: http://www.asp.net/get-started/websites
So there are 3 main types of websites in asp.net today
ASP.NET MVC : This is a modern web application framework. It's what stackoverflow was built with and what you probably want to learn. Anyone doing web development in asp.net is using this.
ASP.NET WebForms: This is an older framework that was meant to make web development feel like desktop development. It has support for drag and drop and while kinda cool, the abstraction creates a lot of problems with scaling. I would avoid this if you can.
ASP.NET WebSites: This is a simple platform for smaller sites/personal pages. It's similar to basic php in that you write code directly on the page itself. Aside from smaller projects and hobbyists, it's not really used in industry.
Edit: All the ASP.NET MVC goodness is here http://www.asp.net/mvc
I really recommend that you take your training into your own hands. Read up on MVC, make a few practice projects, take a look at the MVC source code, read tech blogs on MVC, read the MSDN Documentation on MVC, the asp.net site is a great source of information http://www.asp.net/mvc.
If you are constantly waiting for someone else to hand you training you are going to run into issues, if you want to be a successful developer you have to be proactive in learning new technologies and how things work. You can't expect your work to train you all the time, hopefully they will give you some training at some point but your really need to be proactive.
Honestly, http://www.asp.net/ is probably by far one of the best resources out there--aside from that I've done most of my training on Pluralsight (definitly worth the money if you can afford it or get your employer to pony up for it).
Otherwise, this blog post has some of the best advice with books listed that I've found for learning C# (and actually helps point you down any path). It was invaluable to me until I finally forked out for Pluralsight: http://www.nicoschuele.com/posts/teach-yourself-to-code-with-c-and-net
In addition to the http://www.asp.net/mvc link given by kbst I'd highly suggest taking a look at this video course from Microsoft Virtual Academy http://www.microsoftvirtualacademy.com/training-courses/introduction-to-asp-net-mvc
I thought it was a very helpful introduction and general overview of MVC. I'm not even a big fan of learning via videos, but I felt like this taught me a lot when I first started looking into ASP.net MVC.
There are much better tutorials available on the official asp.net site: http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-1 it's much easier than what that code project article suggests.
What you are looking for is a database connection library. There are some "built-in" in .NET but there are also lots of third-party (external libraries).
You could use old school ADO.NET where you pass strings of SQL Queries and get results back, then have to process the rows of data into what you want. This is old-school and not really recommended anymore.
You could use LINQ to SQL which is a bit more modern but deprecated and frowned upon because it only works with SQL Server. LINQ is a kind of query language (like SQL) but in C# and without using strings to construct the queries.
Going third-party you could use the Entity Framework which is by MS and is the replacement for LINQ to SQL. It is what is called an Object-Relational Mapper (an ORM). Which means that you give it queries (using LINQ) to execute and what you get back are lists of C# objects rather than "rows" of data. The objects will be populated with the values from the data.
There are also "micro-ORMs" that are more lightweight than Entity Framework. Subsonic, Dapper.NET, and others come to mind.
With all of these technologies, the connection string that you refer to (which is usually stored in the config file of the app) can be used to "create the connection" to the database. Each of those technologies will have a way to initialize the connection and will require that connection string.
If I were you and just starting out I would start with Entity Framework as you will find more documentation/examples on the "MVC with Entity Framework" combination than anything else.
http://www.asp.net/entity-framework is a good place to start.
What types of apps are you interested in creating? Web or Desktop?
Most things are going web-based these days, so I'm going to suggest: http://www.asp.net/get-started.
MSDN and Microsoft in general have a ton of resources to learn C#/ASP.NET. A wealth of knowledge can be obtained from here: http://www.microsoftvirtualacademy.com/
I recommend you look into the following stack: SQL Server > Entity Framework > .NET WEB API > .NET MVC 4 > KnockoutJS+HTML5
The learning materials below can be done in an afternoon. All you need is Visual Studio 2012 and SQL Server (express versions will do)
So grab a coffee and happy coding!
The good news. Your database code is still valid. You can reuse your logic too.
If you have good code separation already then it could be as simple as replacing the UI element of your application with the appropriate web views.
If it were me I would be looking at MVC to allow this. http://www.asp.net/mvc This is a very powerful way of building .net applications and by default separates the business logic, data and UI.
I too was a Windows Forms developer who transitioned into ASP :) I ended up building a blog engine as my first project with some help from this very good <em>series</em>.
I later came accross this end-to-end tutorial by Microsoft that teaches you how to build a system predicated on CRUD that I might have used had I known about it.
There is a lot of good content over at http://www.asp.net. For a list of good community content, check out http://www.asp.net/mvc/overview/additional-resources.
James Chambers recently put together this series of articles on bootstrapping MVC which is really worth a read: http://jameschambers.com/2014/06/day-0-boothstrapping-mvc-for-the-next-30-days/
I think a pretty good candidate if you're using already ASP.Net MVC is ASP.Net Web api.
You would define a REST web service for your Windows service to communicate with your MVC app. You can even probably re-use part of your model and controller actions.
About the burden on IIS, it of course depends on the amount of communication each of the services will make. 100 client is not that much for a web service, but of course it they transfer megabytes of data per seconds, it will be complicated.
How much data you think would be transferred from your windows service to the main app?
If you know HTML, you might feel at home with C#'s web framework. You will gain an understanding of how modern C# apps are written, complete with database interaction, web service communication and task parallelism.
By far, the simplest solution would be an implementation of the SimpleMembershipProvider. You can have authentication (user/password) and authorization (roles, permissions levels) up and running within an hour or two.
http://www.asp.net/web-pages/tutorials/security/16-adding-security-and-membership
I completely agree with this.
I work in .NET land but even if I didn't I'd use Visual Studio + ReSharper for HTML/CSS/JS. I know it sounds insane but just look at a few of the things it can do: http://www.codefall.io/4-jun-2014/visual-studio-html-editor.html
It supports pure HTML5 applications as well as Node, C#/VB.NET so you don't need to use any of the code behind features.
But seriously, just look at freaking Browser Link.
Google and Microsoft both have massive open source offerings. Facebook has even open sourced their physical server infrastructure.
http://www.asp.net/web-forms/videos/how-do-i/choosing-the-right-programming-model
Our web developers won't touch WebForms applications. They're tired of WebForms injecting crappy HTML onto the page.
It's all done client-side using JavaScript. For quick reference and to help with the search, you will find a lot of information under the umbrella of AJAX (I've heard the term AJAJ when using JSON, but it's the same concept).
Conceptually, you use JavaScript to listen for push notifications from the server (you could also pull, but push has less traffic). Once you get a change notification, you will call more JavaScript that will update the DOM by injecting the new elements you need/want.
Note this is not a fundamentally ASP.NET technology, but Microsoft does provide some AJAX controls you can use. http://www.asp.net/ajax I think they are meant for Web Forms instead of MVC though, so your mileage may vary.
No, Model-View-Controller has no 'code behind'. No 'controls'. No 'pages'. No 'postbacks'.
MVC revolves around the natural http request/response cycle. Requests are routed to the controller. A data model is created and passed to the view. The view is pure html with access to the model using razor syntax.
Take a look at http://www.asp.net/mvc/tutorials/mvc-5/introduction/adding-a-view
They are two different frameworks built ontop of .NET.
Webforms is old, MVC is new(ish). Webforms tries to emulate a windows style application with state, event handlers and controls. It is an large abstract layer that tries to hide away the web. I find it unnatural and bloated.
MVC I feel is a more natural solution when building web apps. MVC stands for model-view-controller; Code is partitioned into three parts : The view which describes the presentation (HTML and CSS), the Model which describes the data-object (your user(s)) and the controller handles the http request by gluing the model and view together in an orgy of awesomeness.
http://www.asp.net/mvc/tutorials/mvc-5/introduction/getting-started