Ok, So I tried changing my code around a little to match the example you gave so I could make sure I understood how it was working, but I'm getting the following error:
Compiler Error Message: CS1002: ; expected
Source Error:
Line 8: public partial class instructors : System.Web.UI.Page
Line 9: {
Line 10: Protected Sub ImageMap1_Click(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ImageMapEventArgs) Handles ImageMap1.Click
Line 11: Table1.Rows(0).BackColor = Drawing.Color.Blue
Line 12: Table1.Rows(1).BackColor = Drawing.Color.White
And here's the code if you need it:
(from instructors.aspx)
- <asp:ImageMap ID="ImageMap1"
-
ImageURL="images/instructors.jpg"
-
runat="server"
-
AlternateText="Image of a group of kayaking instructors"
-
Width="447" Height="266">
-
-
<asp:RectangleHotSpot
-
AlternateText="Image of a kayaking instructor- Jardina"
-
Left="20" Top="60" Right="104" Bottom="236"
-
HotSpotMode="PostBack" PostBackValue="1" />
-
-
<asp:RectangleHotSpot
-
AlternateText="Image of a kayaking instructor- Cheung"
-
Left="96" Top="17" Right="172" Bottom="169"
-
HotSpotMode="PostBack" PostBackValue="2" />
-
-
<asp:RectangleHotSpot
-
AlternateText="Image of a kayaking instructor - Reimer"
-
Left="172" Top="17" Right="235" Bottom="165"
-
HotSpotMode="PostBack" PostBackValue="3" />
-
-
<asp:RectangleHotSpot
-
AlternateText="Image of a kayaking instructor- Miolla"
-
Left="235" Top="26" Right="297" Bottom="155"
-
HotSpotMode="PostBack" PostBackValue="4" />
-
-
<asp:RectangleHotSpot
-
AlternateText="Image of a kayaking instructor- Lembright"
-
Left="297" Top="23" Right="370" Bottom="158"
-
HotSpotMode="PostBack" PostBackValue="5" />
-
-
<asp:RectangleHotSpot
-
AlternateText="Image of a kayaking instructor- Yaron"
-
Left="370" Top="24" Right="436" Bottom="128"
-
HotSpotMode="PostBack" PostBackValue="6" />
-
-
</asp:ImageMap>
- <asp:Table ID="Table1" runat="server" border="1">
-
<asp:tablerow>
-
<asp:tablecell><B>Instructor Name</B></asp:tablecell>
-
<asp:tablecell><B>Certification Level</B></asp:tablecell>
-
</asp:tablerow>
-
-
<asp:tablerow>
-
<asp:tablecell>Bob Jardina</asp:tablecell>
-
<asp:tablecell>Swift-Water Rescue Instructor</asp:tablecell>
-
</asp:tablerow>
-
-
<asp:tablerow>
-
<asp:tablecell>Lisa Cheung</asp:tablecell>
-
<asp:tablecell>River Guide Training Instructor</asp:tablecell>
-
</asp:tablerow>
-
-
<asp:tablerow>
-
<asp:tablecell>Judy Reimer</asp:tablecell>
-
<asp:tablecell>Kayak Instructor II</asp:tablecell>
-
</asp:tablerow>
-
-
<asp:tablerow>
-
<asp:tablecell>Wendy Miolla</asp:tablecell>
-
<asp:tablecell>Kayak Instructor I</asp:tablecell>
-
</asp:tablerow>
-
-
<asp:tablerow>
-
<asp:tablecell>Jody Lembright</asp:tablecell>
-
<asp:tablecell>Kayak Instructor II</asp:tablecell>
-
</asp:tablerow>
-
-
<asp:tablerow>
-
<asp:tablecell>Dave Yaron</asp:tablecell>
-
<asp:tablecell>River Guide Training Instructor</asp:tablecell>
-
</asp:tablerow>
-
-
</asp:Table>
(this is from instructors.aspx.cs)
-
using System;
-
using System.Collections.Generic;
-
using System.Linq;
-
using System.Web;
-
using System.Web.UI;
-
using System.Web.UI.WebControls;
-
-
public partial class instructors : System.Web.UI.Page
-
{
-
Protected Sub ImageMap1_Click(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ImageMapEventArgs) Handles ImageMap1.Click
-
Table1.Rows(0).BackColor = Drawing.Color.Blue
-
Table1.Rows(1).BackColor = Drawing.Color.White
-
Table1.Rows(2).BackColor = Drawing.Color.White
-
Table1.Rows(3).BackColor = Drawing.Color.White
-
Table1.Rows(4).BackColor = Drawing.Color.White
-
Table1.Rows(5).BackColor = Drawing.Color.White
-
Table1.Rows(6).BackColor = Drawing.Color.White
-
-
Select Case e.PostBackValue
-
Case 1
-
Table1.Rows(1).BackColor = Drawing.Color.Yellow
-
Case 2
-
Table1.Rows(2).BackColor = Drawing.Color.Yellow
-
Case 3
-
Table1.Rows(3).BackColor = Drawing.Color.Yellow
-
Case 4
-
Table1.Rows(4).BackColor = Drawing.Color.Yellow
-
Case 5
-
Table1.Rows(5).BackColor = Drawing.Color.Yellow
-
Case 6
-
Table1.Rows(6).BackColor = Drawing.Color.Yellow
-
End Select
-
End Sub
-
}
-
Do you know what's causing that error? Am I putting something in the wrong place?...if so, where should it be. Sorry if I sound so lost.... haven't really done much with ASP.