Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

syntax error on ASP ?

Posted on 2016-08-09
6
52 Views
Last Modified: 2016-08-09
I have two session variables and I want to display region A if the value of both is the same
And if the value of both is differnent then display region B

Somehow I am getting an error, I checked the value for both and both sessions have value =  31809

I get an error on the first line of the code below:

<% If Session("QnrUserId") = Session("Qnrmainuserid") Then %>
REGIONA
<% End If ' %>
<% If Session("QnrUserId") <> Session("Qnrmainuserid") Then %>
REGION B
<% End If ' %>

Open in new window


I am not sure what the problem is with the syntax if any. I get the following error:

Microsoft VBScript runtime error '800a000d'

Type mismatch

/bluedot/questionnaire/qnr_08.asp, line 190 

Open in new window


line 190 is the first line on the code above.
0
Comment
Question by:amucinobluedot
  • 3
  • 3
6 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 41748793
which of those lines is line 190?

anyhow, what about using "else" in this context?

<% If Session("QnrUserId") = Session("Qnrmainuserid") Then %>
REGIONA
<% Else  %>
REGION B
<% End If %>

Open in new window

I also notice some trailing quotes (after end if) in the posted code, that might also be the issue
what are the values of those session values?
0
 

Author Comment

by:amucinobluedot
ID: 41748794
As I mentioned, the first line is line 190

This is line 190:  <% If Session("QnrUserId") = Session("Qnrmainuserid") Then %>

I am not sure why even with the else I get the error:

Microsoft VBScript runtime error '800a000d'

Type mismatch

/bluedot/questionnaire/qnr_08.asp, line 190

Both sessions exist and both have the same numeric value

If I display the value on the page I get this:

qnruserid = 31809
qnrmainuserid = 31809
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 41748803
please output the typename(Session("QnrUserId") ) and typename(Session("Qnrmainuserid") ) for debugging. at some point, it must be different data types, or another line of code, otherwise the message would not make any sense...
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

Author Comment

by:amucinobluedot
ID: 41748813
I understand and if you read above that is what I did, both have the same value  =  31809
Is it possible the problem is actually on a different line ?
0
 

Author Closing Comment

by:amucinobluedot
ID: 41748834
I will use a work around. for some reason if I log out then log in the page works fine, but not if I create the user and go to that page directly.
Thanks for the 'else' tho  :)
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 41749123
then it was likely null values / nothing objects ...
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question