Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: New to ASP+ (.NET technology) - looking for guidance


Message #1 by "Chris Kersey" <ckersey@m...> on Wed, 29 Aug 2001 12:29:28 -0700
Hi all,



I've been programming .asp for about 4 years now and I'm starting in on .NET

technology for the first time.  Can someone point me in a useful direction.



I created a form validation object (.dll) that uses getcontext to grab the

Request object for handling http requests such as form posts and want to

begin designing something similar using aspx. I don't know that much about

.aspx and it's capeabilities for form validation and form element

persistence and how you can use it to handle missing form fields.



As a small sample of what I have been doing with my component that I would

like to do with .aspx, I created a component that parses the request object

for hidden fields looking for input fields marked as required.  If the

required field was missing data, the self posting form would detect the

missing field and would not increment an internal counter thus preventing

the next step to be displayed.  Sample psuedo code follows:



myObject = server.createobject

myObject.Initialize(Request) '// if no missing fields detected and first

post: increment internal counter to 1

                                           '// else increment counter if no

missing fields detected

                                           '// if error sent in, don't

increment and set error state in object so methods

                                           '// so methods below can display

the error and which fields raised it.



Select Case MyObject.CurrentStep

    Case 1 : DisplayLogin() '// contains html that sets hidden form value to

current step

    Case 2:  DisplaySomeForm()

    Case 3:  UpdateDatabaseWithFormData()

End Select



set myobject = nothing



My object is global and accessed in each of the Methods above to output html

form elements such as <input type=foo> and repopulate the values from

previous steps or database drawn data. Pressing a previous or next submit

button would re-populate the form fields on the previous or next page if

they were filled out by the user, and the user is prevented from going

forward if any of the validation rules are not met, marking the fields that

caused the problem.



Question:  does aspx handle form element persistence in a similar fashion to

the object I created and are there any tutorials on how to do such a task

either online or in printed format.



Again, thanks for any guidance or recommended readings you have to offer.

Chris Kersey

ckersey@m...






  Return to Index