C
CJM
I'm converting a simple query/reporting page from ASP to ASP.NET as a
learning tool. A search box is presented to the user where they enter an ID
number to search for. The page posts back to itself, and a results table is
displayed showing the record requested - pretty simple stuff.
From what I can see so far, there are a number of ways of tackling this, and
probably a few that I dont know of yet(!). In ASP, the first thing I did was
determine whether the page had just been called or whether the form had been
submitted and results where needed. The program flow basically split the
page in two: If form submitted, show results, Else show initial page...
I could presumably follow the same approach in .NET, but I can see that a
number of alternatives are available. I could place the result table with
empty fields in the form from the start but hide it until the right time,
where the codebehind page would populate the table cell values... I could
place an empty table in the form (a placeholder effectively), and
dynamically add row & cells from the codebehind page... Or could dynamically
create both pages from scratch from the code...
I'm sure there are other alternatives asl well. Being fairly new to this,
it's hard to figure what the best approach is. I dont want my ASP background
to influence my design - I'd like to learn the best practices for .NET, and
I'm trying to cut out much of the inevitable trial & error that comes with
starting out. Most of the books & tutorials I have access to are rather
symplistic and rarely are demonstrations of good practice!
So given this scenario, what are the best approaches that you can recommend?
I realise much of this will be influenced by personal style & preferences.
Thanks in advance...
Chris
learning tool. A search box is presented to the user where they enter an ID
number to search for. The page posts back to itself, and a results table is
displayed showing the record requested - pretty simple stuff.
From what I can see so far, there are a number of ways of tackling this, and
probably a few that I dont know of yet(!). In ASP, the first thing I did was
determine whether the page had just been called or whether the form had been
submitted and results where needed. The program flow basically split the
page in two: If form submitted, show results, Else show initial page...
I could presumably follow the same approach in .NET, but I can see that a
number of alternatives are available. I could place the result table with
empty fields in the form from the start but hide it until the right time,
where the codebehind page would populate the table cell values... I could
place an empty table in the form (a placeholder effectively), and
dynamically add row & cells from the codebehind page... Or could dynamically
create both pages from scratch from the code...
I'm sure there are other alternatives asl well. Being fairly new to this,
it's hard to figure what the best approach is. I dont want my ASP background
to influence my design - I'd like to learn the best practices for .NET, and
I'm trying to cut out much of the inevitable trial & error that comes with
starting out. Most of the books & tutorials I have access to are rather
symplistic and rarely are demonstrations of good practice!
So given this scenario, what are the best approaches that you can recommend?
I realise much of this will be influenced by personal style & preferences.
Thanks in advance...
Chris