我在 asp.net 项目上工作时遇到问题,当从 asp.net 页面调用 Web 用户控件时,调用成功,但脚本 JavaScript 或 jQuery 未被调用,那么为什么不调用脚本,只能从调试页面加载...
我在 asp.net 项目上工作时遇到问题,当从 asp.net 页面调用 Web 用户控件时
成功但未调用脚本 JavaScript 或 jQuery
那么为什么脚本没有被调用
仅从调试页面加载用户控件仅在index.asp.net页面上调用
因此函数脚本 jQuery GET_ITO_PROJECTS_DASHBOARD 未调用或运行,为什么
调用用户控件的 c#
页面加载事件
索引.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/WebPages/main.Master" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="ITO.WebPages.index" EnableEventValidation="false" %>
<%@ Register Src="~/WebUserControls/UC_ProjectsDashboard.ascx" TagPrefix="uc2" TagName="UC_ProjectsDashboard" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<uc2:UC_ProjectsDashboard runat="server" />
</asp:Content>
用户控件 UC_ProjectsDashboard.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UC_ProjectsDashboard.ascx.cs" Inherits="ITO.WebUserControls.UC_ProjectsDashboard" %>
<div class="row">
<div class="col-12">
<div id="card-main_Index" class="card customCard card-outline-primary">
<div class="card-header">
<h4 class="m-b-0 text-white card-title text-center">
<label id="lblTitle" runat="server" clientidmode="Static">Project Dashboard</label>
</h4>
</div>
<div class="card-body">
<div class="row" style="margin-top:10px;">
<div class="col-12 col-lg-1">
</div>
<div class="col-12 col-lg-5 gvResultmeeting-container hide">
<div class="form-group">
<div class="card card-outline-success">
<div class="card-header" style="background-color: #808080; font-size: 18px; padding: .75rem 1.25rem; font-weight: 600; height: 50px; color: #ffffff;">
الاجتماعات التمهيديه
</div>
<div class="card-body">
<table id="gvResultmeeting" class="table table-striped table-hover table-bordered">
<thead>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-5 gvResultrequests-container hide">
<div class="form-group">
<div class="card card-outline-success">
<div class="card-header" style="background-color: #ffcc00; font-size: 18px; padding: .75rem 1.25rem; font-weight: 600; height: 50px; color: #ffffff;">
الرد على الاستفسارات
</div>
<div class="card-body">
<table id="gvResultrequests" class="table table-striped table-hover table-bordered">
<thead>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-1">
</div>
</div>
<div class="row" style="margin-top:10px;">
<div class="col-12 col-lg-12">
<div class="form-group">
<div class="card card-outline-success">
<div class="card-header" style="font-size: 18px; padding: .75rem 1.25rem; font-weight: 600;color: #ffffff;">
المشروعات
</div>
<div class="card-body">
<table id="gvResultprojects" class="table table-striped table-hover table-bordered">
<thead>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function () {
debugger
if ($("#txtP_PERM_ID").val() == "2059") {
GET_ITO_PROJECTS_DASHBOARD();
}
});
</script>