asp.net c# sample code library of comon tasks/ boiler plate code - asp.net

anyone use/ know of any library or website with code snippets or samples with many of the mundane boilerplate code and/ or functions like data access, data scrubbing, recursive routines...
preferably c# since most of .net in the real world is c#. VB is ok too.

There is a lot of good stuff (specifically for 'Data Access') in the Microsoft Patterns & Practices Enterprise Library here. For scrubbing HTML and input from websites there's the Microsoft Web Protection Library (AntiXSS) here.

There is a bunch of snippets here (CSharp Online).
Though, the best chance is to simply google/bing for the task you are trying to achieve - there are so many blogs and other sources of data (MSDN) out there. It's my first port of call.

Related

EventStore example applications with source?

can anyone point me to any EventStore sample application with source code?
I'm learning event storing and want to view a reference implementation.
There seems to be a lack of full-featured sample projects for a lot of this stuff. So far the best option for EventStore/CommonDomain that I've found is Haf's Documently project on GitHub. You can find both source code and wiki pages there. It seems to gloss over some of the complications of real-world apps but it was enough to get me started with my own prototyping.

Microsoft WebMatrix: what is it?

I'm a little confused about new Microsoft products.
I'm a classic webform Asp.Net developer. I know exists also Asp.Net MVC with a different approach based on Mvc pattern.
Now, i know exists also WebMatrix that uses new Razor "notation".
Can someone explain me what are the main difference between that "technology" ? When use WebMatrix, when WebForm ?
Thanks!
Webmatrix is a platform that integrates a variety of recently released technologies such as IIS Express, Asp.Net Webforms, Razor, SQL Express etc. I guess from what I have been reading it's a way that eases the barrier to entry, for non-MS developers, into the MS world. In addition you can also use code your site in PHP and use a variety of open source tools for developing web sites. To directly answer your question, in you planning on creating a complex web application, WebMatrix may not be the solution you're looking for.
As a reference, I suggest reading through Scott Gu's Introduction to Webmatrix
WebMatrix will be able to take
advantage of these technologies to
facilitate a simplified web
development workload that is useful
beyond professional development
scenarios – and which enables even
more developers to be able to learn
and take advantage of ASP.NET for a
wider variety of scenarios on the web.
If you are a professional developer
who has spent years with .NET you will
likely look at the below steps and
think – this scenario is so basic -
you need to understand so much more
than just this to build a “real”
application. What about encapsulated
business logic, data access layers,
ORMs, etc? Well, if you are building
a critical business application that
you want to be maintainable for years
then you do need to understand and
think about these scenarios.
Imagine, though, that you are trying
to teach a friend or one of your
children how to build their first
simple application – and they are new
to programming. Variables,
if-statements, loops, and plain old
HTML are still concepts they are
likely grappling with. Classes and
objects are concepts they haven’t even
heard of yet. Helping them get a
scenario like below up and running
quickly (without requiring them to
master lots of new concepts and steps)
will make it much more likely that
they’ll be successful – and hopefully
cause them to want to continue to
learn more.
One of the things we are trying to-do
with WebMatrix is reach an audience
who might eventually be able to be
advanced VS/.NET developers – but who
find the first learning step today too
daunting, and who struggle to get
started.
If someone is still interested: a pretty good lessons here http://habrahabr.ru/company/microsoft/blog/136004/ . This link is for those, who understand russian.
Shortly speaking WebMatrix allows you to conveniently mix up C# server code and html (this mixing is provided by simple Razor sytax). Also in WbeMatrix 2.0(beta version now) is provided full IntelliSense for html/css/c# code.

What language can be used to automate web test?

I'm working on a Web Service which is associated with a form that requires inputs from user. The problem is the fields are quite large, approximately 200 fields need to be filled in. I would like to ask what language would serve best in this case, in term of automating inputs.
I tried Ruby with Watir, but it doesn't work as expected when dealing with iframe. So I'm looking for an alternative solution. Any feedback or suggestion would be greatly appreciated. My WS is developed using ASP.NET and Java Script.
Thanks,
Chan
Selenium may provide the functionality you're looking for. It is a testing framework that supports recording tests, so writing scripts is optional. It does however provide scripting functionality in a variety of languages, including Java, C#, Ruby, Python and more.
Have you tried WatiN? It is an open source automated test framework for Web application. And it support C# and other managed languages.

Do I need to learn c# beforestarting to work with 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

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...

Resources