Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/460.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript HttpCompileException未经用户代码处理(当我在脚本中添加c#代码时)_Javascript_C#_Jquery_Exception_Model View Controller - Fatal编程技术网

Javascript HttpCompileException未经用户代码处理(当我在脚本中添加c#代码时)

Javascript HttpCompileException未经用户代码处理(当我在脚本中添加c#代码时),javascript,c#,jquery,exception,model-view-controller,Javascript,C#,Jquery,Exception,Model View Controller,我有一个.aspx表单,希望在运行时显示在e网格上。 我为我的网格写了一个脚本,它有5列。在某个地方,我只需要4列就可以显示在那里,我不会使用if条件 在我的脚本中,我还需要检查if条件,我不知道如何在脚本中添加c代码。谁能帮我解决这个问题。。。 提前谢谢 我的网格代码 <fieldset> <legend> <%=Labels.Labels.Encounter%></legend> <table clas

我有一个.aspx表单,希望在运行时显示在e网格上。 我为我的网格写了一个脚本,它有5列。在某个地方,我只需要4列就可以显示在那里,我不会使用if条件

在我的脚本中,我还需要检查if条件,我不知道如何在脚本中添加c代码。谁能帮我解决这个问题。。。 提前谢谢

我的网格代码

 <fieldset>
    <legend>
        <%=Labels.Labels.Encounter%></legend>

    <table class="zeebra sortable fwTable EncounterSearchDiv" id="EncounterTable" name="EncounterSearch"
        border="1">
        <thead>
            <tr>
                <th style="cursor: pointer;">
                    <%=Labels.Labels.PatientName%>
                </th>
                <th style="cursor: pointer;">
                    Status
                </th>
                 <%if (commonClassUtil.User.Role.Name != RoleType.FrontDesk)
                   {%>
                <th style="cursor: pointer;">
                    <%=Labels.Labels.EncounterSearch%>
                </th>
                <%} %>
                <th style="cursor: pointer;">
                    <%=Labels.Labels.Date%>
                </th>
                <th style="cursor: pointer;">
                    <%=Labels.Labels.VisitId%>
                </th>
                <%--<th style="cursor:pointer;"><%=Labels.Labels.EncounterId%></th>
            <th style="cursor:pointer;"> <%=Labels.Labels.FromDate%> </th>
            <th style="cursor:pointer;"><%=Labels.Labels.ToDate%> </th>
                <th style="cursor:pointer;"> PID</th>
                <th style="cursor:pointer;"><%=Labels.Labels.PatientName%></th>
                <th style="cursor:pointer;">Dentist/Hygienist</th>
                <th style="cursor:pointer;"><%=Labels.Labels.Location%></th>
                <th style="cursor:pointer;"><%=Labels.Labels.SSN%> </th>
                <th class="sorttable_nosort"><%=Labels.Labels.Action%></th>
                <th style="cursor:pointer;">Status</th>--%>
            </tr>
        </thead>
        <tbody>
            <%
                foreach (PatientRecord patientRecord in ViewData.Model.EncounterDetails)
                {
            %>
            <tr>
                <td>
                    <u><a href="#" onclick="window.location='/Emr/Patients/Show?PID=<%=patientRecord.Patient.Id%>';">
                        <%= CommonUtil.DisplayFormattedName(patientRecord.Patient.FirstName,patientRecord.Patient.MiddleName,patientRecord.Patient.LastName)%></a></u>
                </td>
                <td style="width: 115px;">
                    <%  string patientVisitStatus = "";
                        patientVisitStatus = CommonUtil.GetPatientVisitStatus(patientRecord.PatientVisitStatus);
                        if (patientVisitStatus != "Completed")
                        {
                            patientVisitStatus = "Open";
                        }      
                    %>
                    <%=patientVisitStatus %>
                </td>
                <%if (commonClassUtil.User.Role.Name != RoleType.FrontDesk)
                  {%>
                <td style="width: 300px;">
                    <%if (patientVisitStatus == "Completed")
                      {%>
                    <select id="EncounterStatus<%=patientRecord.Id%>" name="Status" style="font-size: 11px;
                        width: 171px;" >
                        <option value="0">--Select--</option>
                        <%if (ViewData.Model.UserDetails != null)
                          {%>
                        <%foreach (User operatoryType in ViewData.Model.UserDetails)
                          { %>
                        <%if (operatoryType.FirstName != null && operatoryType.FirstName.ToString() != "")
                          {%>
                        <option value="<%=operatoryType.Id%>">
                            <%=operatoryType.FirstName.Trim() + " " + operatoryType.LastName.Trim()%>
                        </option>
                        <%} %>
                        <%} %>
                        <%} %>
                    </select>
                    <%if (ViewData.Model.EncounterRequestDetails.Where(al => al.PatientRecord.Id == patientRecord.Id && al.RequestStatus == "Approved").Count() > 0)
                      {

                          var pinq = ViewData.Model.EncounterRequestDetails.Where(al => al.PatientRecord.Id == patientRecord.Id && al.RequestStatus == "Approved").Select(al => al.PIN).FirstOrDefault();  
                    %>
                    <script type="text/javascript">
                    debugger;
                        var e = document.getElementById("EncounterStatus"+<%=patientRecord.Id%>);
                        e.disabled=true;
                       e.value=<%=ViewData.Model.EncounterRequestDetails.Where(al => al.PatientRecord.Id == patientRecord.Id && al.RequestStatus == "Approved").Select(al => al.RequestTo).FirstOrDefault()%>;
                    </script>
                    <a id="OverrideRequest<%=patientRecord.Id%>"  class="tu_fl_iframe_600x500 tip button"
                        title="" onclick="CheckStatus(<%=patientRecord.Patient.Id%>,'Approved', <%=patientRecord.Id%>,<%=pinq%>);">
                        Approved</a>
                    <%} %>
                    <% else if (ViewData.Model.EncounterRequestDetails.Where(al => al.PatientRecord.Id == patientRecord.Id && al.RequestStatus == "Pending").Count() > 0)
                    { %>
                    <a id="OverrideRequest<%=patientRecord.Id%>" class="tu_fl_iframe_600x500 tip button"
                        title="" onclick="CheckStatus(<%=patientRecord.Patient.Id%>,'Request Sent', <%=patientRecord.Id%>,null);">
                        Request Sent</a>
                    <%}%>
                    <% else if (ViewData.Model.EncounterRequestDetails.Where(al => al.PatientRecord.Id == patientRecord.Id && al.RequestStatus == "Rejected").Count() > 0)
                    { %>
                    <a id="OverrideRequest<%=patientRecord.Id%>" class="tu_fl_iframe_600x500 tip button"
                        title="" onclick="CheckStatus(<%=patientRecord.Patient.Id%>,'Rejected', <%=patientRecord.Id%>,null);">
                        Rejected</a>
                    <%}%>
                    <% else
                    {%>
                    <a id="OverrideRequest<%=patientRecord.Id%>" class="tu_fl_iframe_600x500 tip button"
                        title="" onclick="CheckStatus(<%=patientRecord.Patient.Id%>,'Pending', <%=patientRecord.Id%>,null);">
                        Override</a>
                    <%}
                      }%>
                </td>
                <%} %>
                <td>
                    <%=(patientRecord.DateOfServiceFrom != null && patientRecord.DateOfServiceFrom.ToString() != "1/1/1753 12:00:00 AM") ? DateTimeUtil.GetFormattedDate(patientRecord.DateOfServiceFrom) : ""%>
                </td>
                <td>
                    <%=patientRecord.Id %>
                </td>
                <%-- <td><%=patientRecord.Id %></td>
     <td><%=(patientRecord.DateOfServiceFrom != null && patientRecord.DateOfServiceFrom.ToString() != "1/1/1753 12:00:00 AM") ? DateTimeUtil.GetFormattedDate(patientRecord.DateOfServiceFrom) : ""%></td>
        <td> <%=(patientRecord.DateOfServiceTo != null && patientRecord.DateOfServiceTo.ToString() != "1/1/1753 12:00:00 AM") ? DateTimeUtil.GetFormattedDate(patientRecord.DateOfServiceTo) : ""%></td>

            <td><%= patientRecord.Patient.PatientMRN%></td>
            <td><a href="#" onclick="window.location='/Emr/Patients/Show?PID=<%=patientRecord.Patient.Id%>';"><%= CommonUtil.DisplayFormattedName(patientRecord.Patient.FirstName,patientRecord.Patient.MiddleName,patientRecord.Patient.LastName)%></a></td>
            <td><%= CommonUtil.DisplayFormattedName(patientRecord.Physician.FirstName, patientRecord.Physician.MiddleName, patientRecord.Physician.LastName)%></td>
            <td><%=patientRecord.Location.Name%></td>
            <td><%=patientRecord.Patient.Ssn %></td>
            <td>
            <%=Html.ActionLink<PatientRecordsController>(c => c.ShowPatientRecord(patientRecord.Id), " ", new { @class = "detailsButton", title = "patient Record Details" })%>

            <%CommonClassUtil commonClassUtil = CommonClassUtil.GetCommonClassUtil();
              UtilityDto utilityDto = commonClassUtil.UtilityDto; %>

            <%if (utilityDto.RoleName == RoleType.OfficeManager || utilityDto.RoleName==RoleType.FrontDesk){ %>
            <%=Html.ActionLink<WaitingRoomController>(c => c.ShowPaymentDetails(patientRecord.Id), " ", new { @class = "paymentDetails", title="View Payment Details" })%>
            <%} %>

            </td>
            <td style="width: 115px;">
       <%string patientVisitStatus = "";
        patientVisitStatus= CommonUtil.GetPatientVisitStatus(patientRecord.PatientVisitStatus); 
         if(patientVisitStatus.Equals("In Clinician Waiting Room",StringComparison.OrdinalIgnoreCase))
        {
          patientVisitStatus="In Waiting Room";
        }      
        %>
        <%=patientVisitStatus %>      

</td>--%>
            </tr>
            <%} %>
        </tbody>
    </table>
</fieldset>

地位
--挑选--
al.PatientRecord.Id==PatientRecord.Id&&al.RequestStatus==“已批准”).Count()>0)
{
var pinq=ViewData.Model.EncounterRequestDetails.Where(al=>al.PatientRecord.Id==PatientRecord.Id&&al.RequestStatus==“已批准”)。选择(al=>al.PIN.FirstOrDefault();
%>
调试器;
var e=document.getElementById(“EncounterStatus”+);
e、 禁用=真;
e、 value=al.PatientRecord.Id==PatientRecord.Id&&al.RequestStatus==“已批准”)。选择(al=>al.RequestTo.FirstOrDefault()%>;
c、 ShowPatientRecord(patientRecord.Id),“”,新建{@class=“detailsButton”,title=“病历详细信息”})%>
c、 ShowPaymentDetails(patientRecord.Id),“”,新的{@class=“paymentDetails”,title=“查看付款详细信息”})%>
--%>
我的脚本代码

 <script type="text/javascript">
    $(function () {
        debugger;
  var a=" <%CommonClassUtil commonClassUtil = CommonClassUtil.GetCommonClassUtil(); %> ";
       <%?????????%>
        //$('#TAB-12').addClass('selected');
        oTable = $('.EncounterSearchDiv').dataTable({
            "aaSorting": [[0, "asc"]],
            "bPaginate": true,
            "bLengthChange": true,
            "bFilter": true,
            "bSort": true,
            "bInfo": true,
            "bAutoWidth": true,
            "bRetrieve": true,
            "bDestroy": true,
            "aoColumns": [
     null,
     null,
     null,
     null,
     null]
        });
    });

$(函数(){
调试器;
var a=“”;
//$('#TAB-12').addClass('selected');
oTable=$('.EncounterSearchDiv').dataTable({
“aaSorting”:[[0,“asc”]],
“bPaginate”:对,
“bLengthChange”:正确,
“bFilter”:没错,
“bSort”:正确,
“宾福”:没错,
“bAutoWidth”:没错,
“bRetrieve”:没错,
是的,
“aoColumns”:[
无效的
无效的
无效的
无效的
空]
});
});

我已通过使我的代码类似于tis解决了我的问题

<%=Html.Hidden("User",CommonClassUtil.GetCommonClassUtil().User.Role.Name)%>
 <script type="text/javascript">
    $(function () {
        debugger;
        var user = document.getElementById('User').value;

       if (user != "Front Desk" )
          {

        //$('#TAB-12').addClass('selected');

            oTable = $('.EncounterSearchDiv').dataTable({
                "aaSorting": [[0, "asc"]],
                "bPaginate": true,
                "bLengthChange": true,
                "bFilter": true,
                "bSort": true,
                "bInfo": true,
                "bAutoWidth": true,
                "bRetrieve": true,
                "bDestroy": true,
                "aoColumns": [
                         null,
                         null,
                         null,
                         null,
                         null]
            });

            }else{
             oTable = $('.EncounterSearchDiv').dataTable({
                "aaSorting": [[0, "asc"]],
                "bPaginate": true,
                "bLengthChange": true,
                "bFilter": true,
                "bSort": true,
                "bInfo": true,
                "bAutoWidth": true,
                "bRetrieve": true,
                "bDestroy": true,
                "aoColumns": [
                         null,
                         null,
                         null,
                         null
                        ]
            });

           } 

    });

$(函数(){
调试器;
var user=document.getElementById('user')。值;
如果(用户!=“前台”)
{
//$('#TAB-12').addClass('selected');
oTable=$('.EncounterSearchDiv').dataTable({
“aaSorting”:[[0,“asc”]],
“bPaginate”:对,
“bLengthChange”:正确,
“bFilter”:没错,
“bSort”:正确,
“宾福”:没错,
“bAutoWidth”:没错,
“bRetrieve”:没错,
是的,
“aoColumns”:[
无效的
无效的
无效的
无效的
空]
});
}否则{
oTable=$('.EncounterSearchDiv').dataTable({
“aaSorting”:[[0,“asc”]],
“bPaginate”:对,
“bLengthChange”:正确,
“bFilter”:没错,
“bSort”:正确,
“宾福”:没错,
“bAutoWidth”:没错,
“bRetrieve”:没错,
是的,
“aoColumns”:[
无效的
无效的
无效的
无效的
]
});
} 
});

我已通过使我的代码类似于tis解决了我的问题

<%=Html.Hidden("User",CommonClassUtil.GetCommonClassUtil().User.Role.Name)%>
 <script type="text/javascript">
    $(function () {
        debugger;
        var user = document.getElementById('User').value;

       if (user != "Front Desk" )
          {

        //$('#TAB-12').addClass('selected');

            oTable = $('.EncounterSearchDiv').dataTable({
                "aaSorting": [[0, "asc"]],
                "bPaginate": true,
                "bLengthChange": true,
                "bFilter": true,
                "bSort": true,
                "bInfo": true,
                "bAutoWidth": true,
                "bRetrieve": true,
                "bDestroy": true,
                "aoColumns": [
                         null,
                         null,
                         null,
                         null,
                         null]
            });

            }else{
             oTable = $('.EncounterSearchDiv').dataTable({
                "aaSorting": [[0, "asc"]],
                "bPaginate": true,
                "bLengthChange": true,
                "bFilter": true,
                "bSort": true,
                "bInfo": true,
                "bAutoWidth": true,
                "bRetrieve": true,
                "bDestroy": true,
                "aoColumns": [
                         null,
                         null,
                         null,
                         null
                        ]
            });

           } 

    });

$(函数(){
调试器;
var user=document.getElementById('user')。值;
如果(用户!=“前台”)
{
//$('#TAB-12').addClass('selected');
oTable=$('.EncounterSearchDiv').dataTable({
“aaSorting”:[[0,“asc”]],
“bPaginate”:对,
“bLengthChange”:正确,
“bFilter”:没错,
“bSort”:正确,
“宾福”:没错,
“bAutoWidth”:没错,
“bRetrieve”:没错,
是的,
“aoColumns”:[
无效的
无效的
无效的
无效的
空]
});
}否则{
oTable=$('.EncounterSearchDiv').dataTable({
“aaSorting”:[[0,“asc”]],
“bPaginate”:对,
“bLengthChange”:正确,
“bFilter”:没错,
“bSort”:正确,
“宾福”:没错,
“bAutoWidth”:没错,
“bRetrieve”:没错,
是的,
“aoColumns”:[
无效的
无效的