Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple IF/ELSE javascript help

Status
Not open for further replies.

Mike555

Technical User
Feb 21, 2003
1,200
US
Hi. I'm trying to set a javascript variable named tire_type equal to a vb.net variable named TireBrand. TireBrand is a PUBLIC variable in the code-behind. As you can see I'm trying to set tire_type = "AfterMarket" if the TireBrand varible is Null.

However, I keep getting the error "Name 'ProductTitle' is not declared."

<script language="javascript">
if (<%=TireBrand%> != null)
tire_type="<%=TireBrand%>";
else if (<%=TireBrand%> = null)
tire_type="AfterMarket";
</script>

Can someone please tell me what I'm doing wrong? Thanks!
 
Misprint - The error I'm receiving is...
"Name 'TireBrand' is not declared."
 
You'll get a more procise answer by asking in the ASP.NET forum (and not using the classic ASP way of coding i.e. embedded <% %> tags).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top