本文介绍了不影响MVC动态部分视图中的Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hi,
I have loaded a partial view dynamically from an sqlstored procedure and added as child of a masterpage.All the styles are affected but the javascript(menu_script.js)
Here is my masterpage
<!DOCTYPE html>
@{
ViewBag.Title = "payroll_master";
}
<html lang="en">
<head>
<title>Payroll User</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link href="@Url.Content("~/css/bootstrap-responsive.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/css/style.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/css/menu_style.css")" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="container">
<div class="row-fluid padng">
@{ Html.RenderPartial("partial_Payrollmenu", "PayrollClient"); }
@RenderBody()
</div>
</div>
<script src="@Url.Content("~/js/jquery-1.10.1.js")" type="text/javascript"></script>
@* <script src="@Url.Content("~/js/bootstrap.min.js")" type="text/javascript"></script>*@
<script src="@Url.Content("~/Scripts/json.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Custom_js/common.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Custom_js/Connection.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Custom_js/menu.js")" type="text/javascript"></script>
<script src="@Url.Content("~/js/menu_script.js")" type="text/javascript"></script>
</body>
</html>
我的部分查看页面
My Partial view Page
<div class="span12" id="div1">
</div>
这是我的Jquery电话
Here is my Jquery call
$(document).ready(function (e) {
info = [];
var userId = $('#lblUserName').text();
if (userId.length > 0) {
mvc3_crunch.common.GetData('/menu/getmenu', "UserId=" + userId, null, OnSuccessCall, OnErrorCall);
}
});
var OnSuccessCall = function (result) {
$("#div1").html(result.toString());
}
请帮帮我
谢谢&此致,
Soumya
Please help me
Thanks & Regards,
Soumya
推荐答案
请帮帮我
谢谢&此致,
Soumya
Please help me
Thanks & Regards,
Soumya
这篇关于不影响MVC动态部分视图中的Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!