I am trying to modify the Commerce Starter Kit using C#. The
Commerce Starter Kit comes with a Master Page that comtains controls as
follows:
========================================================================================================
<><%@ Master Language="C#" AutoEventWireup="true" CodeFile="site.master.cs" Inherits="site" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link id="Link1" rel="stylesheet" type="text/css" href='js/modal/subModal.css' runat="server" />
<meta name="description" content="Description here" />
<meta name="keywords" content="Keywords here" />
<title></title>
</head>
<body>
<script src="<%=Page.ResolveUrl("~/js/effects/prototype.js") %>" type="text/javascript"></script>
<script src="<%=Page.ResolveUrl("~/js/effects/scriptaculous.js") %>" type="text/javascript"></script>
<form id="elForm" runat="server">
<div id="header">
<div id="logo">
<a
href="<%=Page.ResolveUrl("~/default.aspx")%>"><img
src="<%=Page.ResolveUrl("~/images/csklogo.gif")%>" alt="Your Logo
Here"/></a>
</div>
<div id="menu1">
<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
<ul>
<li
class="first"><a
href="<%=Page.ResolveUrl("~/basket.aspx")%>"><img
src="<%=Page.ResolveUrl("~/images/icons/cart.gif")%>"
align="absmiddle" alt=""/> My Cart
<%if(ShowBasket()){%>(<%=this.GetItemCount()%>)<%}
%></a></li>
<li><a href="<%=Page.ResolveUrl("~/login.aspx")
%>">Log In</a></li>
<li><a href="<%=Page.ResolveUrl("~/login.aspx")
%>">Register</a></li>
</ul>
</AnonymousTemplate>
<LoggedInTemplate>
<ul>
<li
class="first">Welcome Back <%=Page.User.Identity.Name
%>!</li>
<li><a
href="<%=Page.ResolveUrl("~/basket.aspx")%>"><img
src="<%=Page.ResolveUrl("~/images/icons/cart.gif")%>"
align="absmiddle" alt=""/> My Cart <%if (ShowBasket())
{%>(<%=this.GetItemCount()%>)<%} %></a></li>
<li><a
href="<%=Page.ResolveUrl("~/myorders.aspx")%>">My
Orders</a></li>
<li><asp:LinkButton
ID="lnkLogout" CausesValidation="false" runat="server" Text="Log out"
OnClick="lnkLogout_Click"></asp:LinkButton></li>
</ul>
</LoggedInTemplate>
</asp:LoginView>
</div>
<div id="mainmenu">
<ul>
<li>
<li><a href="<%=Page.ResolveUrl("~/default.aspx")%>" id="tab_Home" class="selected">Home</a></li>
<li><a href="http://forums.asp.net/AddPost.aspx?ForumID=139#" id="tab_Services">Services</a></li>
<li><a href="http://forums.asp.net/AddPost.aspx?ForumID=139#" id="tab_Contact">Contact</a></li>
<li><a
href="<%=Page.ResolveUrl("~/About.aspx")%>" id="tab_About">About</a></li>
<li><a
href="<%=Page.ResolveUrl("~/AboutSelected.aspx")%>" id="tab_AboutSelected" class="selected">AboutSelected</a></li>
<%if(Page.User.IsInRole("Administrator")){ %>
<li><a
href="<%=Page.ResolveUrl("~/admin") %>" id="tab_Admin">Admin</a></li>
<%} %>
</ul>
</div>
</div>
<div id="bar">
<div id="searchbar">
Search:
<input
type="text" name="txtSearch" /><a href="http://forums.asp.net/AddPost.aspx?ForumID=139#"
onclick="location.href='<%=Page.ResolveUrl("~/search.aspx")%>?q='+document.forms[0].txtSearch.value">
<asp:Image
ID="btnSearch" runat="server" SkinID="doSearch" ImageAlign="AbsMiddle"
/></a>
</div>
</div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
<!--#INCLUDE File=includes/modal_divs.aspx-->
</form>
</body>
</html>
<script type="text/javascript">
function popItScroll(theLink){
window.open(theLink,null,'height=800,width=700,scrollbars=yes,resizable=yes');
}
function showIt(theBox){
if(theBox.style.display==""){
theBox.style.display="none";
}else{
theBox.style.display="";
}
}
function toggleIt(theBox){
if(theBox.style.display=="none"){
new Effect.Appear(theBox);
}else{
new Effect.Fade(theBox);
}
}
</script>
<>========================================================================================================
The <li> 's in the <div id = mainmenu> now
contain a <li><a href= ~~~~~~~ id="tab_Home"
that I added.
I can find examples that show how to change
the Text for a Label control on a Master Page -but- I can't find how to
address the class atribute from the Master Page for a
href..... When the About tab is clicked in the PageLoad of the
About page I am trying to set the class="selected" of the
tab_Home to class = "" and then set the
class="selected" for the tab_About. All that I am trying to do is
to shift the Highlight from the tab_Home tab to the tab_About
tab..... This seems to me to be a simple thing that everyone
using tabs would want to do ?
I guess that the real question is:
I have found examples like ((Label)Master.FindControl("Label1")).Text = TextBox1.Text;
-but- this is a Label - - - how can I do a FindControl for a <li><a href ???
Can someone please help on this issue ?
Thanks in advance,
Paul