Adding Funscript to an existing ASP.NET MVC project - asp.net

I really like the FunScript's idea of writing F# instead of Javascript, but I cannot find any samples on how to integrate FunScript int an existing ASP.NET MVC solution.
Is it even possible? A "real-world example" would be really useful.

Igor, you can check out the blog post that I have written and the solution that accompanies on it on Github.
http://namelessinteractive.com/FullStackFSharpLongVersion_Part1
Essentially it is an MVC application with FunScript integration.

F# is for server not for the Client
so i think use f# is not a good idea
if you do not like Javascript
use TypeScript is a good idea

Related

How to implement Data Scaffolding in .Net

I am going to start a project in ASP.Net and want to implement Data Scaffolding as it would be a good learning curve and the deadline is short. All i have understood till now is that Data Scaffolding is used to automatically create web pages accoring to data, to facilitate developer to write less code (Do less, Have More).
Can anyone provide me a good guide to do that thing? or some tutorial?
You could google it with little effort:
http://weblogs.asp.net/scottgu/archive/2011/05/05/ef-code-first-and-data-scaffolding-with-the-asp-net-mvc-3-tools-update.aspx for MVC or http://msdn.microsoft.com/en-us/library/ee377606%28v=vs.100%29.aspx if you are using asp.net web forms

How to install F# and use it from aspx page

I am looking for simple answer about installation but without .msi and Visual Studio.
I don't use VS, I put dll files inside bin folder, write something to web.config and put import in a page.
But for F#, I can't find anything about it, if I find it, its useless for last version of F#.
Same goes for IronPython, and many others :)
If anyone is using asp.net in this "strange" "not normal" way like me, maybe can help
Thank you
The PowerPack includes a CodeDom provider, but generally speaking, you will be unsuccessful using F# directly to create a WebForms application. You can create your code behind files in a separate F# library and reference those types in your C# WebForms pages. Dan Mohl has several such templates available on nuget.org. Despite much pleading from the F# community, this is the current best approach.
If you want more F#-like approaches, check out figment, WebSharper, and frank.
You cannot use F# in aspx.
ASP.Net only allows three languages C# or VB or J#
For more information please read: -
Programming Languages in ASP.NET

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

Using MVC for new parts of a Webforms project

I really like the MVC "way" and have actually enjoyed learning ASP.NET MVC (I never liked ASP.NET Webforms but I didn't know why until now). The problem is I'm about to inherit a bunch of Webforms code and wondered if I'll be able to add new things to the codebase with MVC instead off using Webforms. I suppose it depends a lot on how authentication is set up and if the code is set up in a way that I can include some library or something and just use those function or if I'll have to recreate them or gasp duplicate them somewhere else. What should I worry about? Should I just stop messing with MVC and get working on Webforms or can I make it work together so that if I need to modify something from the Webforms codebase I can just remake it the MVC way as I move along?
I would recommend attempting to only add new stuff using MVC and convert over the legacy webforms code as you can.
This is a pretty decent post of putting them both together in the same project:
http://www.chadmyers.com/Blog/archive/2007/11/30/asp.net-webforms-and-mvc-in-the-same-project.aspx
Scott Hanselman has a post that talks just a little about it in his blog. If you want to start going down the MVC route then go for it. I think it probably depends on how big the ASP.NET Webforms app is.
Well, MVC is built on top of Asp.Net so they should be able to play well together. The question is if the data is structured in such a way that it would lend itself to using the MVC framework and ideology.
Also think about the maintainability of it -- and not just for yourself, but for others. It might be better to just stick to webforms depending on where the application state is at. If you have to start doing more work just to get the application to work, it might not be worth the hassle.

Resources