Visual C# & codebehind

T

Tony

Just wondering about something - I'm relatively new to C# & not quite sure
about a few things...

I've created a "breakout" style game in Visual C#. I have also made a small
web application using VB with aspx pages - basically scripting them like a
regular ASP page or a PHP page.

I have read about "codebehind", where, it seems, you create code independent
of the application and then include that code later. (As I understand, in an
ascx file)

I don't need a detailed explanation of this yet - I'm not quite there yet,
and the books I have get into it pretty well.

What I'd like to know is: How much change needs to be made to a program
written as a Windows application in Visual C# to make that same program run
in codebehind as a web application? Are we talking a couple lines of change,
or completely rewriting the application?

Thanks!
 
M

Mark Broadbent

If you are talking about a windows gui app that you then want to become a
web app you are talking essentially about a rewrite because as you know the
behaviour of web forms differs greatly from winforms. If you are talking
about an application behind the scenes, then essentially your only hurdle
including this in asp.net is simply setting up the correct access rights (if
needed) which shouldn't be too much of a problem to do.

Br,

Mark.
 
T

Tony

Mark Broadbent said:
If you are talking about a windows gui app that you then want to become a
web app you are talking essentially about a rewrite because as you know
the behaviour of web forms differs greatly from winforms. If you are
talking about an application behind the scenes, then essentially your only
hurdle including this in asp.net is simply setting up the correct access
rights (if needed) which shouldn't be too much of a problem to do.

As an example, look at the games on MSN - you can play the games online, and
you can download them to play locally.

Let's say I wanted to do the same thing: It sounds like what you're saying
is that I essentially have to write the game twice - once for the web and
once for the download/install version.

Putting the common functions in a namespace would simplify it (making that
code reusable), but the basic interface portion would have to be done
twice - is that correct?
 
M

Mark Broadbent

I didn't quite say that. All I am saying is that if you have a web interface
and you want to make it a winforms interface then you will need to rewrite
for winforms. If they both can share common code (indeed you should attempt
for this separation of application/ interface) then by all means you should
do so by putting these functions in a common library. With regards to your
example, since I haven't (thankfully) ever used MSN or played the games I
can't say what programmatic interface they are using *but* I would hazard a
guess that they are Shockwave -and that is a completely different kettle of
fish and is not really relevant to .net.

Br,

Mark.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top