Sorry for the simple question but thanks in advance:
My goal is to create reusale code for a web app in C#.
I have written the code already as a windows app but here is where I am
confused:
To keep it really easy let's say this is the code:
function addition(int, int);
int X;
int Y;
int Z = x + y;
return Z;
I want to be able to have this "program" as "compartmentali zed" code so
I code reuse it whenever I need....
Do I:
1. use this as a function?
2. and does the function need to be in a class?
3. how would I "save" this code in some way to use in Application1 or
Application2. Does it get called as a Class or a Function?
4. Do I need to create a Class Library or .DLL? and how does this
relate to namespaces?
5. If we then go to ASP.NET, how would I implement it as reusable for
the web? I could create the form and then use the onSubmit but do I
call the function the class or the .dll?
6. And if I wanted to use it in more than one website, is there a way
to bundle the function as well as the HTML needed to execute it?
////////
Header and encoding info.......
<p>This is the addition sample.
</p>
<form name="form1" method="post" action="">
<p>
<input type="text" name="textfield ">
Enter X</p>
<p>
<input type="text" name="textfield 2">
Enter Y</p>
<p>
<input type="submit" name="Submit" value="Add">
(plus the function or class, .dll?)</p>
<p>
<input type="text" name="textfield 3">
This is returned Z</p>
</form>
//////////////////
Thanks SO much. I REALLY appreciate any and all help!
-Ranginald