私はaspxページに2つのパネルを持っています。ページがロードされると、ステップ1パネルが表示されます。ユーザーがボタンをクリックした後。私はデータをチェックして、ステップ2のパネルを表示します。ここでは、データをコード内のリピータコントロールに表示します。 「戻る」ボタンがあります。ユーザーがこのボタンをクリックすると、ステップ2パネルを非表示にして、ステップ1パネルを再度表示する必要があります。私の問題は、ユーザーが戻るボタンをクリックしたときです。私はstep1が表示されているのを見ることができますが、step2パネルはまだそこにあります。誰かが私にこの問題を解決する助けになるだろうか?事前に感謝スクリプトが実行されても制御ができませんでした
は私のaspxページがあります:
<asp:panel id="pnlStep1" runat="server" visible="False" >
<asp:label id="lbl" text="The order is ....."/>
<asp:Button id="btnNext" runat="server" text="Next" cssclass="btn"/>
</asp:panel>
<asp:panel id="pnlStep2" runat="server" visible="False" >
<fieldset class="fldBoxy"><legend class="fldLegend">Conflicts</legend>
<table class="tbl w100p" border="0">
<tr>
<td class="field100">
<asp:repeater id="repConflicts" runat="server" >
<itemtemplate>
<%# DataBinder.Eval(Container.DataItem, "Details") %>
<br/>
</itemtemplate>
</asp:repeater>
<asp:label id="lblNoConflicts" runat="server" visible="False" text="No conflicts were found."></asp:label>
</td>
</tr>
</table>
</fieldset>
<div class="savechanges">
<table class="w100p" >
<tr>
<td class="talgnL" ><asp:Button ID="btnBack" Text="Back" runat="server" CssClass="btn" OnClientClick="hideStep2()"/>
</td>
<td>
<asp:Button id="btnSave" runat="server" text=" Change" cssclass="btn" />
<input class=" btn" onclick="self.close();" type="button" value="Cancel" />
</td>
<td></td>
</tr>
</table>
</div>
</asp:panel>
私javascritpがあります:
<script language="javascript" type="text/javascript">
function hideStep2(){
var pln = document.getElementById("pnlStep2");
if (pln != 'undefined') {
alert('24');
pln.style.visibility = "hidden";
pln.style.display = "none";
document.getElementById("pnlStep1").style.display = "block";
}
}
</script>
お試しください 'pln.style.visibility =" hidden ";' –
あなたは悪い 'disableafterclick =" True ">を持っています。これはどんなタグにも含まれていません。 – djv
@Verdolinoカットアンドペーストミスがあります。私はそれを編集した。ありがとう。 – user819774