こんにちは、次の JavaScript と DropDownList があります。
function loadanlasstyp(ddl) {
var ControlName = document.getElementById(ddl.id);
if (ControlName.value == "Event") {
window.location = "../book/event.aspx";
}
else if (ControlName.value == "Short Meeting") {
window.location = "../book/shortmeeting.aspx";
}
return true;
}
ドロップダウンリスト:
<asp:DropDownList ID="ddlAnlasstyp" runat="server" CssClass="ff" Height="21px" onChange="javascript:loadanlasstyp(this)"
TabIndex="3" Width="150px">
<asp:ListItem Value="Short meeting">Short</asp:ListItem>
<asp:ListItem Value="Event">Event</asp:ListItem>
</asp:DropDownList>
両方のページに Javascript 関数とドロップダウンリストがあるので、それらを切り替えることができます。"Shortmeeting.aspx" は既定で読み込まれます。DropDownList の [EVENT] をクリックすると、[Shortmeeting.aspx] から [Event.aspx] に切り替えることができます。「Shortmeeting.aspx」に戻りたい場合は、DropDownList の「SHORT」をクリックしますが、機能しません。
これらの 2 つのページを正しく切り替えるにはどうすればよいですか? 助けてください