If Statement Not Working as Expected in ASP Classic -


I have an if..seek statement whether the student is eligible for competition based on the price or not in the database But, my code is not working properly.

My code is as follows:

  & lt;% if (rs_view.Fields.Item ("StudentStatus"). Value = "OK") then% & gt; & Lt; Strong & gt; & Lt; Font color = "# 3300FF" size = "- 1" face = "ariel, helvetica, without-serif" & gt; & Lt;% Response.Write ("You Are Eligible to Contest")% & gt; & Lt; / Font & gt; & Lt; / Strong> & Lt;% other% & gt; & Lt; Strong & gt; & Lt; Font color = "# FF 20000" size = "- 1" face = "ariel, helvicica, without-serif" & gt; & Lt;% Response.Write ("You are not eligible to go to the competition")% & gt; & Lt; / Font & gt; & Lt; / Strong> & Lt;% end if% & gt;  

Any ideas?

  • This does not work correctly. Either the student is not qualified or qualified, it will still not be able to display the qualification status for both.

Perhaps your StudentStatus field is lowercase in your record set? Wrap it into UCS

In addition, you can actually simplify that code for readability ...

  & lt;% soft bucks, messages, rupees copy if (UCSE (Rs_view) ("Student Stats")) = RspMsg = "You are eligible to go for the competition" ## polor = "# 3300FF" Other option RspMsg = "You are not eligible to go for the competition Are "## polor =" # ff0000 "end if & gt%; & Lt; Strong & gt; & Lt; Font color = "& lt;% = RspColor%>" Size = "- 1" face = "ariel, helvetica, without-serif" & gt; & Lt;% = QualificationResponse% & gt; & Lt; / Font & gt; & Lt; / Strong>  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -