General discussion


Enable my VB arrogance

By sjohnson175 ·
I've been building VB applications since 1995 but always desktop only or client/server.

I've tweaked a few ASP pages along the way but have never built one from the ground up. I now have an opportunity to do that but can't use ASP.Net yet as it has not been adopted here.

I'm using InterDev as my editor and the project is a simple data entry piece that will call stored procedures passing the data entered on the form as parameters when a Submit button is clicked.

Can I accomplish this without any of that curly-bracketed JavaScript crap? I just want my Object-dot-method/property I'm used to from the world of VB. Hence my use of the word arrogance. :)

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by Calson In reply to Enable my VB arrogance

Short answer:Yes you can.
Long Answer: How you do it depends on what exactly you want to do. If you need to validate the input, it's going to take a bit longer, and if you need to give the user detailed validation (what field needs to do what, etc.), it's going to take longer still. This simplest method, is to create a HTML form, that submits to a seperate ASP page. This will make it easier to organize your code. In the ASP page, get the form data, and call your stored proc. Then redirect to another page (or back to the form). For validation, then one ASP page would be easier. First, check if form data has been submitted, if not, then display the form. If it has, validate the data, and if there are any errors, display the form and use asp to display the errors.
Here is some simple code to do that (there is much more on the internet):

DIM strEmail, strSubject, strBody
strEmail = Request.Form("Email")
strSubject = Request.Form("SubjectLine")
strBody = Request.Form("Body")

IF strEmail <> "" AND strSubject <> "" AND strComments <> "" THEN

' Process the form here


Response.Write "<p>Please complete the following fields:</p>"
IF strEmail <> "" THEN
Response.Write "<b>? Email</b><br>"
IF strSubject<> "" THEN
Response.Write "<b>? Subject</b><br>"
IF strBody <> "" THEN
Response.Write "<b>? Comments</b><br>"


<!-- Your HTML FORM -->

Related Discussions

Related Forums