Old 05-08-2013, 12:39 PM   #1
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default Web Developement

Is anyone here good at Web development that can give me an idea of how I might take a small utility and convert it to a web app?

Question 1: Assuming that it's a small DotNet app and assuming it only uses standard objects that should also exist on the web (listboxes, buttons, text boxes), if I were inclined to do that, what (besides maybe JavaScript) would be a good language to do that in?

Question 2: How difficult would it be (or is it possible) to have a small app on a web page that creates XML files and then exports them, writes the files to the users system, or at a minimum, allow downloading the result?

Thanks.
Lawrence is offline   Reply With Quote
Old 05-08-2013, 01:37 PM   #2
CaptainBetty
Human being with feelings
 
CaptainBetty's Avatar
 
Join Date: Aug 2009
Location: Oshkosh, WI
Posts: 105
Default

Not that hard... If you're doing .Net you can use your flavor; VB or C#. I program in C# ASP.NET MVC (asp.net/mvc).

You can get all the tools free (visual studio) from the above site and there's tons of tutorials.

To generate the XML, you'd generate the XML on the server from the passed in values (model), and send it down to the client as a filestream.

For client side, you can't go wrong with jQuery as your javascript framework.

Check out stackoverflow.com for all your programing questions too.
__________________
Jon-Paul LeClair
Pearl VMX Red Sparkle
Recording: M-Audio Fast Track Ultra/Reaper/Mackie MR5/Pintech eDrums/Roland TD-12 module
CaptainBetty is offline   Reply With Quote
Old 05-08-2013, 02:45 PM   #3
paterpeter
Human being with feelings
 
paterpeter's Avatar
 
Join Date: Oct 2010
Location: Germany
Posts: 204
Default

From the initial post it sounds as if you were trying to convert an existing desktop application to a web app.

Note that web applications and desktop applications typically work completely different: web applications normally follow a clear request-response approach while desktop applications are stateful.

Depending on how the desktop application is designed (e.g. proper separation of business logic and UI code; how well it would work in a request-response workflow) porting a desktop application to a web app can be a non-trivial task.

While I can wholeheartedly recommend ASP.NET MVC, maybe in your case ASP.NET Web Forms is a viable option as well.

From a programmer's perspective, ASP.NET Web Forms tries to simulate a Windows Forms application in a web environment. That is, you get a similar event driven programming model, a visual editor etc. If you come from a Windows Forms background, Web Forms might feel more familiar, so maybe that is a good starting point in this case.

Note that Web Forms have their own bunch of inherent conceptual problems, mainly because the web just isn't a desktop application. But some developers find this approach easier to pick up.

Sure, personally, I prefer ASP.NET MVC a lot over Web Forms. In fact, I haven't written a Web Forms app in years. Conceptually, Web Forms do a lot of things wrong. Forcing the desktop approach onto a web application only works to a limited degree.

But if you don't have much experience in web development, but do know Windows Forms, and if the application is quite small, Web Forms might be worth a look for quick results.

On the other hand, if you have the intention to actually learn web development more seriously, forget web forms and stick to ASP.NET MVC.

Regards,
Andre

Last edited by paterpeter; 05-08-2013 at 02:50 PM.
paterpeter is offline   Reply With Quote
Old 05-08-2013, 04:06 PM   #4
kindafishy
Human being with feelings
 
kindafishy's Avatar
 
Join Date: Mar 2009
Posts: 4,028
Default

Quote:
Originally Posted by paterpeter View Post
On the other hand, if you have the intention to actually learn web development more seriously, forget web forms and stick to ASP.NET MVC.
...or alternatively, depending on what you are interested in exploring, Java has some wonderfully elegant RESTful programming libraries on the server side for web applications, and you can use an HTML5/JSON/Bootstrap front end.

...or you could do in in PHP.

...or you could do it in Python.

Whether or not any of these things let you do it quickly depends on your definition of quickly.

If you're looking to move from desktop programming to web programming, consider looking at technologies outside .NET offerings. .NET is fine, but you will quickly find the parallels between desktop programming and web programming disappear, so there is little benefit in 'sticking with .NET' when making a change such as this. Since the overall approach is so different, it's an opportunity to look at other options and approaches that are available.
kindafishy is offline   Reply With Quote
Old 05-08-2013, 06:33 PM   #5
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
Originally Posted by Lawrence View Post
Is anyone here good at Web development that can give me an idea of how I might take a small utility and convert it to a web app?

Question 1: Assuming that it's a small DotNet app and assuming it only uses standard objects that should also exist on the web (listboxes, buttons, text boxes), if I were inclined to do that, what (besides maybe JavaScript) would be a good language to do that in?
Staying in .NET with the web app the GUI elements will be similar but different. I don't know of a "converter" but there could be something. All the actual logic would likely stay the same or similar with the occasional caveat. Short explanation, you could probably recreate the desktop form as an ASP.NET form and keep much of the backend code.

Quote:
Question 2: How difficult would it be (or is it possible) to have a small app on a web page that creates XML files and then exports them, writes the files to the users system, or at a minimum, allow downloading the result?

Thanks.
Just make it a download. However, If you want to get fancy (and not deal with managing files on the server that are dynamically created) check out Response.WriteFile() or Response.BinaryWrite(). Both of these essentially write the XML file (in your case) directly to the HTTP stream, which results in the Save/Save As box you see automatically pop up as the end-user. The XML is dynamically generated then sent as bytes to the user and they just save it and no file ever is saved to the server disk, it all happens in memory and on the wire.

Slightly veering if you aren't already familiar, there are things such as Script# which allows you to write code in C# and spit it out as JavaScript. Very, very handy.

Last edited by karbomusic; 05-08-2013 at 06:40 PM.
karbomusic is offline   Reply With Quote
Old 05-08-2013, 06:45 PM   #6
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
so there is little benefit in 'sticking with .NET' when making a change such as this
The benefit should be that the user uses what they know and sticks with what they are personally comfortable with but the result is transparent. Being that he has already invested some time in .NET that is the most logical change because the least number of things need to be changed.

Any of the languages you mentioned at this point in time, including .NET pretty much fit into that category. One can write and compile .NET using something as simple as notepad because it is merely a framework and managed code runtime.

Last edited by karbomusic; 05-08-2013 at 07:15 PM.
karbomusic is offline   Reply With Quote
Old 05-08-2013, 07:03 PM   #7
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
While I can wholeheartedly recommend ASP.NET MVC, maybe in your case ASP.NET Web Forms is a viable option as well.
MVC is pretty cool but I don't "think" Lawrence is going to want to deal with that learning curve. It isn't that big but it could be confusing to someone who didn't arrive at MVC via the steps it took to get there.

Its the current next generation of the ole data/logic/presentation layer mantra that started what... well over a decade or more ago? Its funny how the names keep changing when the goal is really to better abstract those three away from each other while keeping them loosely connected.
karbomusic is offline   Reply With Quote
Old 05-08-2013, 07:16 PM   #8
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

I'd just like to be able to sit down and write small web based apps, nothing fancy, much like I've always done in VB, but not in VB which kinda requires IE to run. Need data storage for sure, read / write capability somewhere. Not necessarily a database.

Not sure where to start or what the easiest path is.

My Javascript isn't bad but I've never wriitten a whole app in JacaScript.
Lawrence is offline   Reply With Quote
Old 05-08-2013, 07:25 PM   #9
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
Originally Posted by Lawrence View Post
I'd just like to be able to sit down and write small web based apps, nothing fancy, much like I've always done in VB, but not in VB which kinda requires IE to run. Need data storage for sure, read / write capability somewhere. Not necessarily a database.

Not sure where to start or what the easiest path is.

My Javascript isn't bad but I've never wriitten a whole app in JacaScript.
You wouldn't need JavaScript and you could use the EXACT code you have been learning as VB.NET. Stuff to learn sure, but getting going is a piece of cake:

Download Visual Studio .NET 2012 Express, get the free registration key and install it. Trust me, they did a really good job on that IDE.

New Project > Visual Basic > Web > ASP.NET Web Forms Application.

Press F5. There ya go a running VB.NET web application.

Right-click Default.ASPX > View Code and what you end up with is:

Default.Aspx = the form/gui/thing user sees.
Default.Aspx.Vb = the backend VB code for that same page.

Notice the similar names as these pages are connected or rather know about each other so if you were to go into Default.aspx.vb in the Page_Load function (same as Form_Load ) and type the following:

Response.Write("Hello World")

Hit F5 again and the web page will open in a browser and say hello world at the top-left of the page. Or you can manually type Hello World in Default.aspx. One is the GUI (the form) one is the Code and they work together just like in a desktop app only the "form" is the web page you see in the browser. Hope that makes sense.

Last edited by karbomusic; 05-08-2013 at 07:36 PM.
karbomusic is offline   Reply With Quote
Old 05-08-2013, 07:43 PM   #10
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

Ah.. so will that run on my Vista laptop system? I'm using VBE 10 there. But that sounds exactly what i need to look at.

Thanks Karbo.
Lawrence is offline   Reply With Quote
Old 05-08-2013, 07:47 PM   #11
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
Originally Posted by Lawrence View Post
Ah.. so will that run on my Vista laptop system? I'm using VBE 10 there. But that sounds exactly what i need to look at.

Thanks Karbo.
I think it will run fine but VS2012 has the latest cutting edge stuff (as well as the older stuff) meaning with Vista it might require some updates. That template I guided you to above is actually a FULL web app including logins and the works. I assume that is also in the Express version IE: I tested with my full version not my laptop that has express on it.

There should be a number of "click here to learn how" links scattered around if you hit F5 and browse the sample site for a bit. There will be things to learn but at least you can get your feet wet and see if its a worthwhile path. FWIW, that template tries really hard to get you moving along. Also, all your old VB.NET projects should open fine in VS2012 since it should be backwards compatible for older VS versions.

NOTE: Download the VS2102 Express for Web. I just remembered the Express versions are Web, Desktop, Windows 8. I think you can install Web and Desktop but for our current discussion and web apps you need the one for web.

Last edited by karbomusic; 05-08-2013 at 07:58 PM.
karbomusic is offline   Reply With Quote
Old 05-08-2013, 09:12 PM   #12
kindafishy
Human being with feelings
 
kindafishy's Avatar
 
Join Date: Mar 2009
Posts: 4,028
Default

Quote:
Originally Posted by karbomusic View Post
The benefit should be that the user uses what they know and sticks with what they are personally comfortable with but the result is transparent. Being that he has already invested some time in .NET that is the most logical change because the least number of things need to be changed.

Any of the languages you mentioned at this point in time, including .NET pretty much fit into that category. One can write and compile .NET using something as simple as notepad because it is merely a framework and managed code runtime.
Makes enough sense to me. You can do that with the other languages mentioned as well (notepad). I've spent significant time working in both .NET and in Java for server side work. Either is a fine choice. Both have fantastic first and third party libraries and elegant core frameworks.

The .NET stuff is probably easier though, I'd think. It has more out-of-the-box designer tools, automatic wiring of widgets to components and that kind of thing.
kindafishy is offline   Reply With Quote
Old 05-08-2013, 09:15 PM   #13
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
Originally Posted by kindafishy View Post

I'd think. It has more out-of-the-box designer tools, automatic wiring of widgets to components and that kind of thing.
True enough for sure. Funny thing is C# is basically well extremely a lot like Java for obvious reasons if you happen to remember way back when there was something called "Visual Java" by MS. C# was its replacement.
karbomusic is offline   Reply With Quote
Old 05-09-2013, 12:48 AM   #14
paterpeter
Human being with feelings
 
paterpeter's Avatar
 
Join Date: Oct 2010
Location: Germany
Posts: 204
Default

Quote:
Originally Posted by karbomusic View Post
True enough for sure. Funny thing is C# is basically well extremely a lot like Java for obvious reasons if you happen to remember way back when there was something called "Visual Java" by MS. C# was its replacement.
If you only stick to pure object-oriented principles, Java and C# are basically interchangeable. As a language to learn OOP, Java is great. Java was never intended to be anything else than a bare bone OOP language. C# OTOH never had this claim of purity. It has evolved much faster and has become a multi-paradigm language. Optional dynamic typing, functional programming (lambda expressions), declarative programming (LINQ) etc. It can be daunting for newcomers to see real life C# code. But in practice, C# is so much more of a productive language for me.

What I always admired about Java is its community. So many awesome open source projects exist for Java. So awesome, that many of them are ported to the .NET world (NHibernate, NUnit, log4net, Lucene.NET etc.).

Another great environment is Ruby. In fact, Ruby on Rails was my first experience with the MVC pattern in a web environment. It felt so great, so "right", that I moved from Web Forms to MVC (Castle MonoRail at that time) immediately.

Quote:
Originally Posted by karbomusic View Post
Its the current next generation of the ole data/logic/presentation layer mantra that started what... well over a decade or more ago? Its funny how the names keep changing when the goal is really to better abstract those three away from each other while keeping them loosely connected.
The MVC pattern first appeared in 1979. So yes, it's basically an old thing. On the other hand, dynamic web application are not *that* old, especially not well designed applications.
BTW, even though there are a couple of architectural patterns that have similar goals as MVC (think MVP or MVVM), they don't necessarily do it the same way. So I think it's good that there are different names for different things, even when their goal is similar.

I think this is kind of derailing the thread. Sorry for that
paterpeter is offline   Reply With Quote
Old 05-09-2013, 06:46 AM   #15
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

I'm a little torn here Karbo.

I'm downloading Express 2012 for Desktop and I hope the other bits you talked about are in there and not in the Web edition. It should be a better IDE than 2010 at any rate.

I suspect you may have the full Visual Studio with all the parts in one package and that (when I finish installing) I might find the other web parts in the other Express for Web package version, but I'll see.

Thanks man. I assumed VSE 2012 was for Win 8 so I never installed it. It seems to be installing on my Vista bootcamp system even though the page doesn't list Vista as being supported.
Lawrence is offline   Reply With Quote
Old 05-09-2013, 06:50 AM   #16
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

Quote:
Originally Posted by karbomusic View Post
True enough for sure. Funny thing is C# is basically well extremely a lot like Java for obvious reasons if you happen to remember way back when there was something called "Visual Java" by MS. C# was its replacement.
My adventures into C++ and Objective C and all that were not pretty.

I was pretty much always a VB6 guy and hesitated moving to VB.NET. I think I finally gave in when I became aware that (or so I was told anyway) even though it's managaed code, it compiles identically to C++ code, no performance difference to speak of.

I assume that's due to the .Net framework being part of the OS.

My biggest challenge with the transition was printing. It was so easy in VB6 and .NET required learning an entirely new not quite as easy at first method.
Lawrence is offline   Reply With Quote
Old 05-09-2013, 09:57 AM   #17
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
Originally Posted by Lawrence View Post
I'm a little torn here Karbo.

I'm downloading Express 2012 for Desktop and I hope the other bits you talked about are in there and not in the Web edition. It should be a better IDE than 2010 at any rate.

I suspect you may have the full Visual Studio with all the parts in one package and that (when I finish installing) I might find the other web parts in the other Express for Web package version, but I'll see.

Thanks man. I assumed VSE 2012 was for Win 8 so I never installed it. It seems to be installing on my Vista bootcamp system even though the page doesn't list Vista as being supported.
I'll be back to my laptop in a couple of hours which has express and will double check for you but I'm postive you need to download the WEB edition. I would want to think it (the template) would be there because it sort of falls in the help me get started category which the Express versions are all about. I know they won't be there in the desktop version however, you can probably install both but don't quote me until I check.
karbomusic is offline   Reply With Quote
Old 05-09-2013, 11:02 AM   #18
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

My gamble didn't pay off.

Although it installed on Vista it won't run. I'll have to consider if I want to install it on my Win 7 studio desktop. Likely not.

Thanks Karbo.
Lawrence is offline   Reply With Quote
Old 05-09-2013, 11:16 AM   #19
sstillwell
Human being with feelings
 
Join Date: Jul 2006
Location: Cowtown
Posts: 1,562
Default

What are you actually wanting to ACCOMPLISH at the end of the day? Learn another toolset, or get a task accomplished? Let that drive your decision. I've used some silly little no-market-share development tools to get jobs done before simply because they were easy to use and got the job done. I've also just used Notepad and written the script and moved on. Do what you need to do.

A lot of what has been said here has been dead on. Idioms that work in desktop apps aren't necessarily suited to web applications, and even when they are, they aren't coded the same way. They may LOOK like it in Visual Studio, but there's SERIOUS voodoo going on behind the scenes to make it happen and work (almost) consistently across browsers.

Example: If you need database data entry/maintenance type apps (so-called CRUD apps), then a fairly cool framework based on .NET can be found at http://www.evolutility.org. Once properly installed, you can create entire entry forms with a single XML file, or even with table-driven entries...there's your model-driven development right there.

Anyway...there's lots of ways to get the job done...you just need to decide what the job IS.

Scott
__________________
https://www.stillwellaudio.com/
sstillwell is offline   Reply With Quote
Old 05-09-2013, 12:05 PM   #20
EJ James
Human being with feelings
 
EJ James's Avatar
 
Join Date: Apr 2013
Location: Frisco, Texas
Posts: 299
Default

If you're going the .NET route, a very simple (and free) tool you might consider is Expression Web. It will support in-line code blocks (versus compiled code-behind) so you can still create pretty robust web application if that's the goal. You won't be able to do near the things you can accomplish in a full version of Visual Studio, but it sounds like that would be overkill for what you're wanting to do anyway.

http://www.microsoft.com/en-us/downl....aspx?id=36179

I use VS 2012 Ultimate at work, but I've resorted to Expression in the past when I didn't have access to my work machine. I've also pointed a few friends in that direction as well.

It's sort of like MS FrontPage on steroids. =)
__________________
My Shit != Your Shit
We each have our own shit.
EJ James is offline   Reply With Quote
Old 05-09-2013, 12:34 PM   #21
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

Quote:
Originally Posted by sstillwell View Post
What are you actually wanting to ACCOMPLISH at the end of the day?
Generally speaking, when things come up I sit down with VB and code a quick solution. The one problem with that is that only Windows users can use it and the only Win users with those frameworks. If I could do similar on a web platform, and have the results, whether that be spitting out xml files for download, text files, binary files, whatever, given back to the user, that would do it.

I don't have anything really specific in mind at the momemt, just investigating the general possibility of what I do in VB on a web platform.

I often wonder why there's not a similarly easy to use (cross platform, major browser compatible) development framework for the web. A web-based object oriented IDE like VBExpress where you could log in, work online, drop controls, write basic code, and save the web page application.

That probably would be a lot of work though, to simplify a good deal of that.
Lawrence is offline   Reply With Quote
Old 05-09-2013, 04:13 PM   #22
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
Originally Posted by Lawrence View Post
My gamble didn't pay off.

Although it installed on Vista it won't run. I'll have to consider if I want to install it on my Win 7 studio desktop. Likely not.

Thanks Karbo.
Sorry, looks like I told you wrong, I just found this:

Supported operating systems

•Windows 7 (x86 and x64)
•Windows 8 (x86 and x64)
•Windows Server 2008 R2 (x64)
•Windows Server 2012 (x64)

Supported architectures

•32-bit (x86)
•64-bit (x64)
karbomusic is offline   Reply With Quote
Old 05-09-2013, 04:24 PM   #23
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

Quote:
Originally Posted by karbomusic View Post
Sorry, looks like I told you wrong...
Not your fault. I saw that on the website before downloading.

Because the install is "managed" by Windows and it proceeded, I thought it might actually 'run' and just not be supported. But it wouldn't even launch... which is odd because (IIRC) typically MS installs will parse the OS and not even install on an OS where it doesn't actualy work.

So... not your fault my friend. The supported OS's are pretty clearly listed there. Thanks.
Lawrence is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:12 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.