我们的ASP.NET应用程序包含顶部的菜单栏(派生自UserControl)和下面的几个标准内容页面。但是,下面的一页不是标准内容页面。它的HTML页面用作AngularJS控制器的视图。有一个"退出"菜单上的选项,当您单击它时,它适用于所有标准内容页面,但不适用于AngularJS视图。当您使用AngularJS视图并单击"退出"时,没有任何反应。当我点击"退出"我也需要退出。当我在AngularJS视图上时。
代码如下:
1)菜单栏的一部分:
<td width="65" align="center" class="mainMenu" onmouseover=" this.style.background = '#F5F6AF'; " onmouseout=" this.style.background = '#E8E8E8'; ">
<site:secureLink ID="CashdeskReport" RunAt="Server" CssClass="MainMenu" Name="report" Allow="wizard,admin,kassaThermo,kassa,kassaPechat,kassaPechatSpec,kassaPechatExt,kassaExpress,kassaManager" URL="../Admin/Admin_Report.aspx" />
</td>
<td width="65" align="center" class="mainMenu" onmouseover=" this.style.background = '#F5F6AF'; " onmouseout=" this.style.background = '#E8E8E8'; ">
<a runat="server" ID="exit" CausesValidation="False">exit</a>
</td>
2)退出代码:
private void exit_Click(object sender, EventArgs e)
{
AuthManager.GetCurrent().LogOut();
Response.Redirect("/Admin/Admin.aspx");
}
3)HTML页面:
<%@ Page language="c#" Codebehind="Default_New.aspx.cs" AutoEventWireup="True" Inherits="Concert.Default_New" %>
<%@ Register TagPrefix="site" TagName="header" Src="includes/Header.ascx" %>
<%@ Register TagPrefix="site" TagName="head" Src="includes/Head.ascx" %>
<!doctype html>
<html id="ng-app" ng-app="cashdeskActionSearchApp">
<head>
<site:head id="Head" runat="Server" />
<link href="bootstrap/v3/css/bootstrap.min.css" rel="stylesheet" type="text/css"></link>
<link href="css/actions.css" rel="stylesheet" type="text/css"></link>
<link href="css/new_search.css" rel="stylesheet" type="text/css"></link>
<link href="includes/Style.css" rel="stylesheet" type="text/css"></link>
<script type="text/javascript" src="Scripts/respond.min.js"></script>
<script src="Scripts/jquery-1.11.1.min.js" type="text/javascript"> </script>
<script src="Scripts/toastr.js" type="text/javascript"> </script>
<script src="Scripts/moment.min.js" type="text/javascript"> </script>
<script src="Scripts/i18n/moment.ru.js" type="text/javascript"> </script>
<script src="bootstrap/v3/js/bootstrap.min.js" type="text/javascript"> </script>
<script src="angular/1.2/angular.min.js"></script>
<script src="angular/1.2/angular-route.min.js"></script>
<script src="angular/angular-resource.min.js" type="text/javascript"> </script>
<%--<script src="angular/angular-cookie.min.js" type="text/javascript"> </script>--%>
<script src="angular/ui-bootstrap/ui-bootstrap-tpls-0.11.0.min.js" type="text/javascript"> </script>
<script src="Scripts/i18n/angular-locale_ru.js"></script>
<script src="/Admin/js/services.js" type="text/javascript"> </script>
<script src="/Admin/js/directives.js" type="text/javascript"> </script>
<script src="Scripts/CashdeskActionSearchApp.js" type="text/javascript"> </script>
</head>
<body bgcolor="#FFFFFF" text="#333333" link="#000000" vlink="#000000" alink="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%--<site:secureChecker ID="CheckRights" runat="Server" Allow="wizard,admin,buhgalter" />--%>
<site:header id="HeaderInclude" runat="server"/>
<!--<h2 style="padding-left: 10px;">Поиск мероприятий</h2>-->
<div>
<div ng-view class="container-fluid">
</div>
</div>
<br/>
</body>
</html>
4)在浏览器的调试器(脚本部分)中的样子:
<!doctype html>
<html id="ng-app" ng-app="cashdeskActionSearchApp">
<head>
<title></title>
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="title" content="">
<meta name="revisit-after" content="7 days">
<meta name="home_url" content="http://www.concert.ru">
<meta name="robots" content="index,all">
<meta name="copyright" content="http://www.concert.ru">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta http-equiv="Content-Language" content="ru">
<link href=includes/Style.css type=text/css rel=stylesheet>
<link href="bootstrap/v3/css/bootstrap.min.css" rel="stylesheet" type="text/css"></link>
<link href="css/actions.css" rel="stylesheet" type="text/css"></link>
<link href="css/new_search.css" rel="stylesheet" type="text/css"></link>
<link href="includes/Style.css" rel="stylesheet" type="text/css"></link>
<script type="text/javascript" src="Scripts/respond.min.js"></script>
<script src="Scripts/jquery-1.11.1.min.js" type="text/javascript"> </script>
<script src="Scripts/toastr.js" type="text/javascript"> </script>
<script src="Scripts/moment.min.js" type="text/javascript"> </script>
<script src="Scripts/i18n/moment.ru.js" type="text/javascript"> </script>
<script src="bootstrap/v3/js/bootstrap.min.js" type="text/javascript"> </script>
<script src="angular/1.2/angular.min.js"></script>
<script src="angular/1.2/angular-route.min.js"></script>
<script src="angular/angular-resource.min.js" type="text/javascript"> </script>
<script src="angular/ui-bootstrap/ui-bootstrap-tpls-0.11.0.min.js" type="text/javascript"> </script>
<script src="Scripts/i18n/angular-locale_ru.js"></script>
<script src="/Admin/js/services.js" type="text/javascript"> </script>
<script src="/Admin/js/directives.js" type="text/javascript"> </script>
<script src="Scripts/CashdeskActionSearchApp.js" type="text/javascript"> </script>
</head>
<body bgcolor="#FFFFFF" text="#333333" link="#000000" vlink="#000000" alink="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<script type="text/javascript" language="javascript" src="src.js"> </script>
<script type="text/javascript" language="javascript">
function MoveMonth(dest) {
document.forms[0].MoveMonthDest.value = dest;
document.forms[0].submit();
}
</script>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
<tr>
</tr>
</table>
<br/>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#E8E8E8">
<tr>
<td width="6"><img src="../img/l.gif" width="6" height="28"></td>
<td width="65" align="center" class="mainMenu" onmouseover=" this.style.background = '#F5F6AF'; " onmouseout=" this.style.background = '#E8E8E8'; ">
<a id="HeaderInclude_CashdeskSearchLink_Link" class="MainMenu" href="Default.aspx">поиск</a>
</td>
<td width="65" align="center" class="mainMenu" onmouseover=" this.style.background = '#F5F6AF'; " onmouseout=" this.style.background = '#E8E8E8'; ">
<a id="HeaderInclude_SecureLink1_Link" class="MainMenu" href="Default_New.aspx">новый поиск</a>
</td>
<td width="65" align="center" class="mainMenu" onmouseover=" this.style.background = '#F5F6AF'; " onmouseout=" this.style.background = '#E8E8E8'; ">
<a id="HeaderInclude_CashdeskOrders_Link" class="MainMenu" href="Admin/Admin_OrderList.aspx">заказы</a>
</td>
<td width="65" align="center" class="mainMenu" onmouseover=" this.style.background = '#F5F6AF'; " onmouseout=" this.style.background = '#E8E8E8'; ">
<a id="HeaderInclude_CashdeskOrder_Link" class="MainMenu" href="Admin/Admin_Order.aspx">заказ</a>
</td>
<td width="65" align="center" class="mainMenu" onmouseover=" this.style.background = '#F5F6AF'; " onmouseout=" this.style.background = '#E8E8E8'; ">
<a id="HeaderInclude_CashdeskReport_Link" class="MainMenu" href="Admin/Admin_Report.aspx">отчет</a>
</td>
<td width="65" align="center" class="mainMenu" onmouseover=" this.style.background = '#F5F6AF'; " onmouseout=" this.style.background = '#E8E8E8'; ">
<a id="HeaderInclude_exit" href="javascript:__doPostBack('HeaderInclude$exit','')">выход</a>
</td>
<td width="250" align="center"><span id="HeaderInclude_lblCashierDeposit" class="m"></span></td>
<td align="right"><b style="color: green;"><span id="HeaderInclude_CashierNameLabel" class="m">Кассир: tesicg</span></b></td>
<td align="right"><img src="img/r.gif" width="6" height="28"></td>
</tr>
</table>
<!--<table border="1" bordercolor="red">
<tr><td>Внимание! Необходимо обновить программу билетопечати до 07.12.2008. После указанного срока не обновленные программы билетопечати будут отключены.<br />
Для обновления программы обратитесь к вашему техническому специалисту. <br />
Если у вас нет техничкского специалиста:<br />
1. скачайте файл <a href="http://www.concert.ru/tp/TicketPrint 2.0.11.zip"><u>http://www.concert.ru/tp/TicketPrint 2.0.11.zip</u></a><br />
2. обратитесь к специалисту Concert.ru по тел.: +7 (903) 249-85-46<br />
<br /></td></tr>
</table>-->
<!--<h2 style="padding-left: 10px;">Поиск мероприятий</h2>-->
<div>
<div ng-view class="container-fluid">
</div>
</div>
<br/>
</body>
</html>
在这里,我不了解用作菜单栏的用户控件与下面的AngularJS视图之间的联系。菜单栏中的所有其他选项都可以正常工作。
答案 0 :(得分:0)
尝试使用runat =“server”属性将页面内容包装到表单标记中:
<body bgcolor="#FFFFFF" text="#333333" link="#000000" vlink="#000000" alink="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form id="form1" runat="server">
<%--<site:secureChecker ID="CheckRights" runat="Server" Allow="wizard,admin,buhgalter" />--%>
<site:header id="HeaderInclude" runat="server"/>
<!--<h2 style="padding-left: 10px;">Поиск мероприятий</h2>-->
<div>
<div ng-view class="container-fluid">
</div>
</div>
<br/>
</form>
</body>