• User Attivo

    Ok...scusa ma non potevo sapere se avevi omesso apposta o no.
    Dunque prova così:

    [html] function UpdateView()
    {
    if (document.getElementById('<%Response.Write(CheckBox8.ClientID);%>').checked==true)
    {
    document.getElementById('<%Response.Write(listbox3.ClientID);%>').style.visibility='hidden'
    }
    else
    {
    document.getElementById('<%Response.Write(listbox3.ClientID);%>').style.visibility='visible'
    }
    }

    [/html]
    dovrebbe funzionare.


  • User

    Ok,grazie domani a lavoro provo e speriamo bene.Per ora grazie e ciao


  • User

    Per curiosità tu sai perchè come avevo scritto non funziona?


  • User Attivo

    @fbrz800 said:

    Per curiosità tu sai perchè come avevo scritto non funziona?
    Semplice, l'id che assegni all'oggetto .net non corrisponde all'id generato in html e che cerchi di recuperare via js.
    Basta che guardi l'html generato e ti accorgi che l'id non è "tuonome" ma "c00_qualcosa" e roba simile.
    In pratica l'id che assegni è visibile solo al codice .net
    Con "nomeoggetto.clientid" accedi all'id client e cioè quello reale html.
    E' più difficile da spiegare che da vedere.


  • User

    Ancora niente forse ti è utile questa riga all'interno del body

    <form id="applicazione" method="post" runat="server">

    devo scrivere la riga che mi hai suggerito esattamente come hai fatto tu o devo fare qualche modifica?
    Mettendola pari pari non succede niente.


  • User Attivo

    La mia riga dovrebbe andare bene ma controlla i case sensitive.
    c# a differenza di VB è case sensitive quindi "listbox3" è diverso da "ListBox3"
    Controlla i nomi.
    Per il resto la procedura che ti ho incollato è corretta a meno che non ci siano altre sorprese nella pagina (per questo spesso c'è bisogno di vederla tutta)


  • User

    [html]<%@ Page language="c#" Codebehind="avanzata.aspx.cs" AutoEventWireup="false" Inherits="eTechPlus.Web.avanzata" %>
    <%@ Register TagPrefix="uc1" TagName="titleBar" Src="titleBar.ascx" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>eTechPlus</title>
    <meta content="False" name="vs_snapToGrid">
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="C#" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="1">
    <LINK href="css/eTech.css" type="text/css" rel="stylesheet">
    </STYLE>
    <script language="javascript">
    function UpdateView()
    {
    if (document.getElementById('<%Response.Write(CheckBox8.ClientID);%>').checked==true)
    {
    document.getElementById('<%Response.Write(Listbox2.ClientID);%>').style.visibility='hidden'
    }
    else
    {
    document.getElementById('<%Response.Write(Listbox2.ClientID);%>').style.visibility='visible'
    }
    }
    </script>
    <script language="javascript" id="clientEventHandlersJS">

    </HEAD>
    <body onload="javascript:LoadRoutines();" MS_POSITIONING="GridLayout">

    <form id="applicazione" method="post" runat="server">

    <asp:listbox id="ListBox15" style="Z-INDEX: 100; LEFT: 170px; POSITION: absolute; TOP: 173px" tabIndex="2" runat="server" Height="22" Width="105px" Rows="1" Font-Size="8pt" Font-Names="Arial"></asp:listbox><asp:listbox id="ListBox1" style="Z-INDEX: 149; LEFT: 603px; POSITION: absolute; TOP: 225px" tabIndex="5" runat="server" Height="24px" Width="180px" Rows="1"></asp:listbox><asp:label id="Label4" style="Z-INDEX: 148; LEFT: 178px; POSITION: absolute; TOP: 347px" runat="server" Height="12px" Width="515px" CssClass="lblSmallBold"></asp:label><asp:label id="Label3" style="Z-INDEX: 147; LEFT: 180px; POSITION: absolute; TOP: 323px" runat="server" Height="14px" Width="512px" CssClass="lblSmallBold"></asp:label><asp:label id="Label2" style="Z-INDEX: 146; LEFT: 181px; POSITION: absolute; TOP: 299px" runat="server" Height="16px" Width="508px" CssClass="lblSmallBold"></asp:label><asp:textbox id="textBox100" style="Z-INDEX: 144; LEFT: 697px; POSITION: absolute; TOP: 352px" runat="server" Height="21px" Width="194px" Font-Size="8pt"></asp:textbox><asp:textbox id="txtBox99" style="Z-INDEX: 143; LEFT: 696px; POSITION: absolute; TOP: 272px" runat="server" Height="21px" Width="194px" Font-Size="8pt"></asp:textbox><asp:checkbox id="CheckBox7" style="Z-INDEX: 141; LEFT: 13px; POSITION: absolute; TOP: 368px" runat="server" Height="17px" Width="178px" Font-Size="X-Small" Font-Bold="True"></asp:checkbox><asp:checkbox id="CheckBox6" style="Z-INDEX: 140; LEFT: 12px; POSITION: absolute; TOP: 348px" runat="server" Height="17px" Width="178px" Font-Size="X-Small" Font-Bold="True"></asp:checkbox><asp:checkbox id="CheckBox5" style="Z-INDEX: 139; LEFT: 12px; POSITION: absolute; TOP: 324px" runat="server" Height="17px" Width="178px" Font-Size="X-Small" Font-Bold="True"></asp:checkbox><asp:checkbox id="CheckBox4" style="Z-INDEX: 138; LEFT: 11px; POSITION: absolute; TOP: 299px" runat="server" Height="17px" Width="178px" Font-Size="X-Small" Font-Bold="True"></asp:checkbox><asp:checkbox id="CheckBox3" style="Z-INDEX: 137; LEFT: 12px; POSITION: absolute; TOP: 275px" runat="server" Height="17px" Width="178px" Font-Size="X-Small" Text="Diagnosi" Font-Bold="True"></asp:checkbox><asp:checkbox id="CheckBox2" style="Z-INDEX: 136; LEFT: 11px; POSITION: absolute; TOP: 252px" runat="server" Height="17px" Width="178px" Font-Size="X-Small" Font-Bold="True"></asp:checkbox>
    <DIV id="pnlCustom" style="Z-INDEX: 131; LEFT: 6px; WIDTH: 1px; POSITION: absolute; TOP: 330px; HEIGHT: 61px" runat="server" ms_positioning="GridLayout"></DIV>
    <INPUT id="hydErrMot" style="Z-INDEX: 130; LEFT: 616px; POSITION: absolute; TOP: 600px" type="hidden" name="hydErrMot" runat="server"><INPUT id="hydErrMod" style="Z-INDEX: 129; LEFT: 456px; POSITION: absolute; TOP: 600px" type="hidden" name="hydErrMod" runat="server"><INPUT id="jsprodID" style="Z-INDEX: 127; LEFT: 136px; POSITION: absolute; TOP: 600px" type="hidden" name="jsprodID" runat="server"><INPUT class="RedButtonNoBorder" id="bttGoToInf" style="Z-INDEX: 125; LEFT: 4px; WIDTH: 192px; POSITION: absolute; TOP: 537px; HEIGHT: 41px" tabIndex="12" type="button" name="bttGoTo" runat="server">
    <asp:label id="Label25" style="Z-INDEX: 124; LEFT: 181px; POSITION: absolute; TOP: 233px" runat="server" CssClass="lblSmallBold"></asp:label><INPUT class="RedButtonNoBorder" id="bttReset" style="Z-INDEX: 122; LEFT: 823px; WIDTH: 113px; POSITION: absolute; TOP: 220px; HEIGHT: 33px" tabIndex="13" type="button" runat="server"><IFRAME id="fresult" style="Z-INDEX: 120; LEFT: 8px; WIDTH: 938px; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; POSITION: absolute; TOP: 469px; HEIGHT: 238px; BORDER-BOTTOM-STYLE: none" name="fresult" src="prova.aspx" runat="server">
    </IFRAME>
    <asp:label id="Label5" style="Z-INDEX: 118; LEFT: 410px; POSITION: absolute; TOP: 209px" runat="server" CssClass="lblSmallBold">Label</asp:label><asp:label id="Label14" style="Z-INDEX: 117; LEFT: 604px; POSITION: absolute; TOP: 201px" runat="server" CssClass="lblSmallBold">Visualizza primi</asp:label><asp:label id="Label10" style="Z-INDEX: 116; LEFT: 496px; POSITION: absolute; TOP: 86px" runat="server" CssClass="lblSmallBold" Visible="False">Label</asp:label><asp:label id="Label1" style="Z-INDEX: 115; LEFT: 421px; POSITION: absolute; TOP: 153px" runat="server" CssClass="lblSmallBold">Label</asp:label><asp:label id="Label2" style="Z-INDEX: 114; LEFT: 279px; POSITION: absolute; TOP: 153px" runat="server" Height="22px" Width="62px" CssClass="lblSmallBold">Label</asp:label><asp:listbox id="Label3" style="Z-INDEX: 107; LEFT: 276px; POSITION: absolute; TOP: 172px" tabIndex="3" runat="server" Height="22" Width="138px" Rows="1" Font-Size="8pt" Font-Names="Arial"></asp:listbox><asp:listbox id="ListBox2" style="Z-INDEX: 106; LEFT: 687px; POSITION: absolute; TOP: 70px" tabIndex="6" runat="server" Width="142px" Rows="1" Font-Size="8pt" Font-Names="Arial"></asp:listbox><asp:listbox id="ListBox1" style="Z-INDEX: 104; LEFT: 418px; POSITION: absolute; TOP: 172px" tabIndex="4" runat="server" Height="22" Width="159px" Rows="1" Font-Size="8pt" Font-Names="Arial"></asp:listbox><asp:listbox id="ListBox3" style="Z-INDEX: 101; LEFT: 559px; POSITION: absolute; TOP: 231px" tabIndex="7" runat="server" Height="0px" Width="0px" Rows="1" Font-Size="0pt" Font-Names="Arial"></asp:listbox><uc1:titlebar id="TitleBar1" runat="server"></uc1:titlebar><asp:label id="" style="Z-INDEX: 113; LEFT: 173px; POSITION: absolute; TOP: 155px" runat="server" CssClass="lblSmallBold">Label</asp:label><asp:textbox id="TextBox150" style="Z-INDEX: 119; LEFT: 405px; POSITION: absolute; TOP: 226px" tabIndex="5" runat="server" Width="184px" Font-Size="8pt" Font-Names="Arial" MaxLength="8"></asp:textbox><INPUT class="RedButtonNoBorder" id="bttSearch" style="Z-INDEX: 121; LEFT: 821px; WIDTH: 112px; POSITION: absolute; TOP: 177px; HEIGHT: 33px" tabIndex="11" type="button" runat="server"><asp:textbox id="txtSearchText" style="Z-INDEX: 123; LEFT: 696px; POSITION: absolute; TOP: 325px" tabIndex="1" runat="server" Width="194px" Font-Size="8pt" Font-Names="Arial"></asp:textbox>
    <TABLE id="Table1" style="Z-INDEX: 126; LEFT: 4px; WIDTH: 192px; POSITION: absolute; TOP: 512px; HEIGHT: 18px" cellSpacing="0" cellPadding="0" width="192" border="0">
    <TR>
    <TD style="WIDTH: 110px"><asp:hyperlink id="hypHelp" runat="server" NavigateUrl="javascript:void(0);" Visible="False"></asp:hyperlink></TD>
    <TD align="right"><asp:hyperlink id="hypLogout" tabIndex="15" runat="server" Visible="False"></asp:hyperlink></TD>
    </TR>
    </TABLE>
    <asp:checkbox id="CheckBox8" style="Z-INDEX: 154; LEFT: 13px; POSITION: absolute; TOP: 392px" runat="server" Font-Size="X-Small" Width="225px" Height="17px" Font-Bold="True" Text="Impianto Elettrico"></asp:checkbox>
    <INPUT id="hydErr1" style="Z-INDEX: 128; LEFT: 296px; POSITION: absolute; TOP: 600px" type="hidden" name="hydErr1" runat="server">

    <asp:button id="btnVK" style="Z-INDEX: 108; LEFT: 321px; POSITION: absolute; TOP: 177px" runat="server" Height="8px" Width="72px" Text="VK"></asp:button><asp:button id="btnVKTelaio" style="Z-INDEX: 109; LEFT: 323px; POSITION: absolute; TOP: 179px" runat="server" Height="8px" Width="72px" Text="VKT"></asp:button><asp:linkbutton id="LinkButton1" style="Z-INDEX: 133; LEFT: 15px; POSITION: absolute; TOP: 583px" runat="server" Height="8px" Width="188px" Visible="False">Change Password</asp:linkbutton><asp:linkbutton id="LinkButton2" style="Z-INDEX: 134; LEFT: 55px; POSITION: absolute; TOP: 512px" runat="server" Height="19px" Width="111px" Visible="False">my e-mail</asp:linkbutton><INPUT id="txtMinScore" style="FONT-SIZE: 8pt; Z-INDEX: 105; LEFT: 374px; WIDTH: 4px; FONT-FAMILY: Arial; POSITION: absolute; TOP: 180px; HEIGHT: 5px" type="text" maxLength="2" size="1" value="39" name="txtMinScore">

    <asp:checkbox id="ckSyn" style="Z-INDEX: 102; LEFT: 440px; POSITION: absolute; TOP: 172px" runat="server" TextAlign="Left" Checked="True"></asp:checkbox><asp:checkbox id="CheckBox1" style="Z-INDEX: 135; LEFT: 12px; POSITION: absolute; TOP: 225px" runat="server" Height="17px" Width="178px" Font-Size="X-Small" Font-Bold="True"></asp:checkbox><asp:textbox id="TextBox11" style="Z-INDEX: 142; LEFT: 696px; POSITION: absolute; TOP: 298px" runat="server" Height="21px" Width="194px" Font-Size="8pt"></asp:textbox><asp:label id="Label1" style="Z-INDEX: 145; LEFT: 183px; POSITION: absolute; TOP: 271px" runat="server" Height="15px" Width="504px" CssClass="lblSmallBold"></asp:label><asp:label id="Label5" style="Z-INDEX: 150; LEFT: 614px; POSITION: absolute; TOP: 157px" runat="server" CssClass="lblSmallBold">Label</asp:label><asp:listbox id="ListBox2" style="Z-INDEX: 151; LEFT: 613px; POSITION: absolute; TOP: 176px" runat="server" Height="30px" Width="144px" Rows="1" Font-Size="8pt" Font-Names="Arial"></asp:listbox></form>
    </body>
    </HTML>
    [/html]


  • User Attivo

    Mizzeca...bel casino sta pagina 😄
    Certo non è tanto facile capire senza vedere gli errori generati ma cmq in linea teorica il js che ti ho fatto dovrebbe andare.
    Prova anche nello c# a sostituire

    CheckBox8.Attributes.Add("onchange", "UpdateView();");
    

    con

    
    CheckBox8.Attributes.Add("onclick", "UpdateView();");
    
    

  • User

    Grande!!!!!!!!!!!Era proprio quello....cambiare onchange con onclick
    Grazie mille!!!!!Sei stato veramente utilissimo.


  • User

    Ciao Sai mica darmi anche una dritta su questo?

    [HTML]
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Menu Rollover ý la Project Seven</title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    <meta name="generator" content="HAPedit 3.0">
    <style type="text/css">
    div
    {
    font-size: 15px;
    font-family: Arial;
    }

    a.MENU
    {
    background-color: #F7F7F7;
    color: #A2A2A2;
    font-weight: Bold;
    text-decoration: None;
    width: 100px;
    padding: 1px;
    border: Solid 1px #000000;
    }
    a:hover.MENU
    {
    background-color:;
    color:;
    font-weight: Bold;
    text-decoration: None;
    width: 100px;
    padding: 1px;
    border: Solid 1px;
    }

    </style>
    </head>
    <body>
    <h3>Benvenuto!</h3>
    <div id="MENU">
    <a class="MENU" href="#">Pagina1</a>
    <a class="MENU" href="#">Pagina2</a>
    <a class="MENU" href="#">Pagina3</a>
    <a class="MENU" href="#">Pagina4</a>
    <a class="MENU" href="#">Pagina5</a>
    <a class="MENU" href="#">Pagina6i</a>

    </div>
    </body>
    </html>

    [/HTML]

    Vorrei mettere lo stato attivo alla Pagina1 in modo che l'utente che naviga da una pagina all'altra sappia in quale si trova(metterei lo stavo attivo diverso su ogni pagina chiamata)