D
-D-
How can I turn the visibility of the xml control on or off?
<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="TopNavBar.ascx.cs" Inherits="compass.user_controls.TopNavBar"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<table cellSpacing="0" cellPadding="0" border="0">
<colgroup span="1" align="left" width="50%">
</colgroup>
<colgroup span="1" align="right" width="50%">
</colgroup>
<tr>
<td>
<asp:Xml Runat="server" DocumentSource="../sitemap.xml"
TransformSource="../topnavigationbar.xslt"
id="Xml1"></asp:Xml>
</td>
<td>
<form style="MARGIN: 0px" name="frmSearch" action="search.asp"
method="post">
Search <input type="text" size="25" name="txtQuery"> <A
href="javascript:document.frmSearch.submit()">
<IMG src="images/go.gif" align="absMiddle" border="0"></A>
</form>
</td>
</tr>
</table>
This is the code behind:
namespace compass.user_controls
{
using System;
using System.Collections;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
using compass.ClassFiles;
/// <summary>
/// Summary description for TopNavBar.
/// </summary>
public class TopNavBar : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.Xml Xml1;
protected System.Web.UI.WebControls.Repeater Repeater1;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
Also, the xslt file generates an unordered list. Is there a way to set the
visibility for one of the list items on or off in the code behind?
For example, if five list items are displaying and I want to hide the
visibility of one of the items, is there a way to do this?
<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="TopNavBar.ascx.cs" Inherits="compass.user_controls.TopNavBar"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<table cellSpacing="0" cellPadding="0" border="0">
<colgroup span="1" align="left" width="50%">
</colgroup>
<colgroup span="1" align="right" width="50%">
</colgroup>
<tr>
<td>
<asp:Xml Runat="server" DocumentSource="../sitemap.xml"
TransformSource="../topnavigationbar.xslt"
id="Xml1"></asp:Xml>
</td>
<td>
<form style="MARGIN: 0px" name="frmSearch" action="search.asp"
method="post">
Search <input type="text" size="25" name="txtQuery"> <A
href="javascript:document.frmSearch.submit()">
<IMG src="images/go.gif" align="absMiddle" border="0"></A>
</form>
</td>
</tr>
</table>
This is the code behind:
namespace compass.user_controls
{
using System;
using System.Collections;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
using compass.ClassFiles;
/// <summary>
/// Summary description for TopNavBar.
/// </summary>
public class TopNavBar : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.Xml Xml1;
protected System.Web.UI.WebControls.Repeater Repeater1;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
Also, the xslt file generates an unordered list. Is there a way to set the
visibility for one of the list items on or off in the code behind?
For example, if five list items are displaying and I want to hide the
visibility of one of the items, is there a way to do this?