"if" question

M

Miguel Dias Moura

Hello,

i have this code line in a script in my ASP.net / VB web site:

if msgNewsletterAction = "Go" Then
code1
Else
code2
End If

code2 runs everytime even when msgNewsletterAction = "Go". code1 never runs.

What is wrong in my sintax?

Thank You,
Miguel
 
A

AT

Miguel Dias Moura said:
Hello,

i have this code line in a script in my ASP.net / VB web site:


How msgNewsletterAction is declared?
Try msgNewsletterAction.ToString()

But msgNewsletterAction can be anything so please add info
 
M

Miguel Dias Moura

Hi,

i declared the variable as follows:

dim msgNewsletterAction

then i got the value from a form:

msgNewsletterAction = Request.Form("newsletterAction")

then i sent the value to an email using AspNetEmail. I readed my email and
there it was...the word "Go".

This is why this is so strange.

Thanks,
Miguel
 
G

Guest

you need to declare as a string if you are checking for a string, I think you have it as a variant type so could try .toString but would be better to delcare a correct type
 
M

Miguel Dias Moura

How can i declare it as a sting?

Thank You,
Miguel

Martin said:
you need to declare as a string if you are checking for a string, I think
you have it as a variant type so could try .toString but would be better to
delcare a correct type
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top