validating input (Me.request.form.get(0))

T

Thierry

Hi



I have a form with two buttons (insert and delete) and I want to validate
the input of those two buttons. How can I get the type of button in the
validation function?



Private Sub CValOrganisationName_ServerValidate

Select Case Me.Request.Form.Get(0)

Case "LinkBtnInsert"

{do something}

Case "LinkBtnDelete"

{do something}

End Select

End Sub



Me.Request.Form.Get(0) = "LinkBtnInsert"



So this works, but wat does that Me.Request.Form.Get(0) mean?

Is there maybe een better solution to this problem?



Thanks,

Thierry
 
S

S. Justin Gengo

I think there is a better solution.

In the code-behind page each button will be registered as an object (if
you're using web forms buttons). Each button then has it's own onclick event
handler. Just place your code for each inside of each button's event
handler.

It would look something like this:

Private Sub MyButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyButton.Click



End Sub


Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top