Whistling in the dark...

No your are not alone, they watch!

Hello,

I just started working with J#, have to admit that it is not
as easy to migrate code to it.

I have some code, I am converting from C#

The problem I have is that I can't resolve the linkStyles control
like I did in vb or c#, I had to use the controls array see Line 1
Even though the control has an ID/Name I still can't refrence it,

What is the problem? I got it to work but it is not so cleanly done.

Thanks
Zack


<HEAD>
<title>Using CSS in VS.NET</title>
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<link id="linkStyles" name="linkStyles" href="Styles/Styles.css" type="text/css" rel="stylesheet" runat="server" />
</HEAD>

Line 1
System.Web.UI.Control ctrl = this.get_Controls().get_Item(1);
System.Web.UI.HtmlControls.HtmlGenericControl htmlLink = (HtmlGenericControl) ctrl;

switch( rblType.get_SelectedIndex())
{
case 1: //Fancy Styles
{
htmlLink.get_Attributes().set_Item
("href","Styles/Customized.css");
//linkStyles.Attributes.Item("href")
= "Styles/Customized.css";
htmlLink.get_Attributes().set_Item("visable","true");
//linkStyles.Visible = True;
}
 
Back
Top