Click here to Skip to main content
15,850,750 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Though I made the necessary changes in the code like adding braces,semicolon and no red line when clicking on the error. I still get this two errors and preventing me to run the solution. Please assist me what else has to be done to rectify it. I was given this codes to review it and I'am stuck here

What I have tried:

HTML
if(very big code)
{
    %>

  <%
}
   else if (ViewState["OfferID"].ToString() == "2521"){
   %>
   <table cellpadding="0" cellspacing="0" width="100%" border="0"></table>
   <%
   }
else if (ViewState["OfferID"].ToString() == "2362")
{
   %>
   <table cellpadding="0" cellspacing="0" width="700px" border="0"></table>
   <%
}
else if (ViewState["OfferID"].ToString() == "1839" || ViewState["OfferID"].ToString() == "1952")
{
    %>
  <table cellpadding="0" cellspacing="0" width="880px" border="0"></table>
      <%
}
else if (ViewState["OfferID"].ToString() == "2015" || ViewState["OfferID"].ToString() == "2014")
{
    %>
  <table cellpadding="0" cellspacing="0" width="744px" border="0"></table>
      <%
}
else
{
    %>
      <table cellpadding="0" cellspacing="0" width="744px" border="0"></table>
          <%
}
              %><table cellpadding="0" cellspacing="0" width="644px" border="0" style="padding: 15px"></table>
Posted
Updated 24-Oct-16 1:31am
v3
Comments
[no name] 21-Oct-16 9:52am    
Comment out the code section by section until you narrow it down. We can't tell from the made up code that you have shown us.

Why don't you store the viewstate value in a var and use it?
Check the braces you must have missed to close one.
What is very big code in the if btw ?
 
Share this answer
 
The wavy braces match so that is not the problem. You do have an unmatched "%>" at the end. Otherwise, I would check that the "very big code" is correct.
 
Share this answer
 
Quote:
Invalid expression term 'else'| ; expected
When asking for help, there is a useful skill: giving useful information.

If you look carefully, you will see that the compiler also tells you where it found the error.

Update the question and put a comment in code to show where the compiler complain.
 
Share this answer
 
Hi guys, thanks for the useful suggestions. But today when I closed and started VS 2010 the errors were gone and the issue got resolved.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900