Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

C# if else problem


  • Please log in to reply

#1
GinaB

GinaB

    New Member

  • Member
  • Pip
  • 7 posts
Hello,

I am new to C# I can not seem to see what the problem is with my if, if else statement....

Does anyone tell me what is off?


<% If (Session["Level"] == "NONE")%>
<!-- <tr> -->
<!-- <td align=right><img src="../images/Seasonal/Vday/happyVday.gif" ></td> -->
<!-- <td align=right><img src="../images/Seasonal/Vday/animated_1.gif"></td> -->
<!-- <td align=Center><img src="../images/Seasonal/StPatDay/happy st pat day 2.jpg"></td> -->
<!-- </tr> -->

</table>
</div>
<% If (Session["Level"] != "NONE")%>


<!-- Add the Menu -->

<script language='JavaScript' src='Includes/Menu.js' type='text/javascript'></script>

<script language='JavaScript'>menuMain("<% =Session("Level") %>", "<% =Session("LoginID") %>");</script>
<%;
else%>

<!-- Add Home and Logout links -->
"<span onmouseout="this.style.backgroundColor='#717171'" onmouseover="this.style.backgroundColor='#b9b9b9'"
style="position: absolute; left: 800px; top: 61px; height: 24px; color: #FFFFFF;
width: 90px; text-align: center;">
<a class="itemText" href="http://korhmfps06/NE...e/HomePage.asp" style="color: #FFFFFF;">
Home Page</a>
</span>
<span onmouseout="this.style.backgroundColor='#717171'" onmouseover="this.style.backgroundColor='#b9b9b9'"
style="position: absolute; left: 890px; top: 61px; height: 24px; color: #FFFFFF;
width: 90px; text-align: center;">
<a class="itemText" href="http://korhmfps06/NE...?Action=Logout" style="color: #FFFFFF;">
Logout</a>
</span>
<%;%>

thanks so much
  • 0

Advertisements


#2
Hai Mac

Hai Mac

    Member

  • Member
  • PipPipPip
  • 260 posts
Hello GinaB,
I am not quite sure what you mean, because I can't see any C# code in your post...
  • 0

#3
destin

destin

    Member

  • Member
  • PipPip
  • 53 posts

Hello GinaB,
I am not quite sure what you mean, because I can't see any C# code in your post...

Yeah, looks like Javascript to me.. but hey, what do I know?
  • 0

#4
darth_ash

darth_ash

    Member 1K

  • Member
  • PipPipPipPip
  • 1,382 posts
It seems to me that your using C# on ASP.NET and your using the code-render programming model(i.e typing C# code inside code-render tags("<% %>") with the rest of the html code).
But, then again I'm not sure because I see that your file extension is .asp and not .aspx.
If my intial presumptions are correct, then look at the following line:
<% If (Session["Level"] == "NONE")%>
C# is case-sensitive and If statements shoud have a lower-case i, i.e is should be:
<% if (Session["Level"] == "NONE")%>

Not getting full compiler support from the C# complier is one of the dis-advantages of the code-render model, why don't you use the code-behind model, i.e. seprating C# and asp.net\html code.

Edited by darth_ash, 15 March 2006 - 12:45 AM.

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP