General discussion

Locked

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.

1 total post (Page 1 of 1)  
| 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

ELSE

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

END IF
%>

<!-- Your HTML FORM -->

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums