无法解决该错误"_backgroundElement.parentNode"为空或不是对象 [英] not abl to solve tihs error '_backgroundElement.parentNode' is null or not an object

查看:57
本文介绍了无法解决该错误"_backgroundElement.parentNode"为空或不是对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<%@ Page  Language="C#" MasterPageFile="~/MasterPages/Main.master" AutoEventWireup="true" CodeFile="Medicine-Details.aspx.cs" Inherits="CMS_Medicine_Details" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

<script language="javascript" type="text/javascript">
    function disableEnterKey(e) {
        var key;
        if (window.event)
            key = window.event.keyCode; //IE
        else
            key = e.which; //firefox      

        return (key != 13);
    }

    function SearchAtKeyEnter(event) {
        if ((event.which == 13) || (event.keyCode == 13)) {
            var btnSearch = document.getElementById('<%=btncompoundSearch.ClientID%>');
            btnSearch.click();
        }
    }
    
     function StartProgressBar() {
         var myExtender = $find('ProgressBarModalPopupExtender');
         myExtender.show();
         return true;
     }
     
     function validation() {
         var txtmedicinename = document.getElementById('<%= txtmedicinename.ClientID %>');
         if (txtmedicinename.value == "" ) {
             alert("Please enter Medicine Name");
             txtmedicinename.focus();
             return false;
         }
         StartProgressBar();
     }        
</script>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
  
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" ScriptMode="Release">

<table border="0" width="100%">
 <tr><td><div id="page-heading-1">Medicine Details</div> </td>
 </tr>
<tr>
<td>
    <asp:Label ID="lbl_msg" runat="server" Text="" CssClass="orange-bold" Visible="true"></td>
    </tr>
</table>
<table style="margin-removed10px;">

 <tr><td style="vertical-align:text-top"><span class="text-orange">*</span>
     <asp:Label ID="lblmedicinename" runat="server" Text="Medicine Name"></td>
     <td>
         <asp:TextBox ID="txtmedicinename" runat="server" Rows="3" TextMode="MultiLine" Width="200px">
     </td></tr>
     
     <tr>
     <td><asp:Label ID="lblform" runat="server" Text="Form"></td>
     <td><asp:TextBox ID="txtform" runat="server" Width="200px" onkeydown="return disableEnterKey(event)"></td>
     </tr>

     <tr>
     <td><asp:Label ID="lblPregnancy" runat="server" Text="Pregnancy"></td>
     <td>
         <asp:DropDownList ID="ddlPregnancy" runat="server" Width="200px">
         
         </td>
     </tr>
     
      <tr>
     <td><asp:Label ID="lblLactation" runat="server" Text="Lactation" Width="200px"></td>
     <td> <asp:DropDownList ID="ddlLactation" runat="server" Width="200px">
         </td>
     </tr>
     
      <tr>
     <td><asp:Label ID="lblLabInterference" runat="server" Text="Lab Interference"></td>
     <td>
         <asp:RadioButtonList ID="rdLabInterference" runat="server" RepeatDirection="Horizontal">
         <asp:ListItem Value="1">Yes
         <asp:ListItem Value="0" Selected="True">No
          
     </td>
     </tr>
     
      <tr>
     <td><asp:Label ID="lblFoodInterference" runat="server" Text="Food Interference"></td>
     <td>
        <asp:RadioButtonList ID="rdFoodInterference" runat="server" RepeatDirection="Horizontal">
         <asp:ListItem Value="1">Yes
         <asp:ListItem Value="0" Selected="True">No
          
     </td>
     </tr>

<tr>
<td>
    <asp:Label ID="lblcompound" runat="server" Text="Compound Names"></td>
    <td>
        <asp:Button ID="brnaddmore" runat="server" Text="Add More" CssClass="btnCommon" 

          OnClientClick="StartProgressBar();" onclick="brnaddmore_Click"  Width="80px" Height="22px"/>
                         
                            </td>
</tr>
<tr>
<td colspan="2">
<asp:UpdatePanel runat="server">
<contenttemplate>
<asp:GridView ID="gvcompound" runat="server"

           

                                      AlternatingRowStyle-CssClass="gridaltitem" AutoGenerateColumns="False" 

                                      CellPadding="4" CssClass="grid" DataKeyNames="CompoundId"

           

                                      HeaderStyle-CssClass="gridheadertable1" 

                                    onrowdeleting="gvcompound_RowDeleting"

                                      PagerStyle-HorizontalAlign="Right" PageSize="15" 

                                 RowStyle-CssClass="griditem" 

        onrowdatabound="gvcompound_RowDataBound">
                                      <rowstyle cssclass="griditem" />
                                    
                                      <columns>
                                      
                                         <asp:BoundField HeaderText="Compound Name" runat="server"  DataField="CompoundName"/>
         
          
                                         <asp:CommandField ShowDeleteButton="True" ButtonType="Button" ControlStyle-CssClass="btnCommon"/>

                                            
                                        
                                         
                                      </columns>
                                      
                                  
                                  </contenttemplate>
                                  
   
</td>
</tr>
<tr><td> </td><td></td></tr>
<tr><td></td><td> <asp:Button ID="btnsave" runat="server" 

        Text="Save" CssClass="btnCommon" onclick="btnsave_Click"  

       OnClientClick="return validation();" Width="100px" Height="25px"/></td></tr>
<tr><td colspan="2"> 
<asp:ModalPopupExtender ID="ProgressBarModalPopupExtender" runat="server" BackgroundCssClass="ModalBackground_2" behaviorID="ProgressBarModalPopupExtender"

                     TargetControlID="hiddenField" PopupControlID="Panel3" />
            <asp:Panel ID="Panel3" runat="server" Style="display: none; background-color: #FFFFFF;">
                 <img src="../Images/green-loader.gif" alt="Loader" />
                  <asp:HiddenField ID="hiddenField" runat="server" /></td>
                  </tr>
                  

</table>
  <asp:UpdatePanel ID="updpnlforDocPnllist" runat="server">
                 <triggers>
                 <asp:AsyncPostBackTrigger ControlID="brnaddmore" /></triggers>
               
                
                            <contenttemplate>
                            
                      <asp:HiddenField ID="hfCompoundID" runat="server" Value="0" />    
                    
                    
     <asp:Panel ID="pnlMainPopup" runat="server" style=" background-color:Transparent; border-width:medium; width:630px; height:450px;text-align:center; display:none;">
       <div style="margin:10px 10px 10px 10px">
                <asp:Panel ID="pnlDoctorChildPreveiw"  runat="server" Visible="true" ScrollBars="Auto"    style="color:Black; background-color:Azure; border-width:medium; vertical-align:middle;width:630px; height:430px;text-align:center;">                            
                         <table id="tbl_certi" align="center" style="margin-removed5px;" width="600px" cellpadding="0px" cellspacing="0px" border="0px">
                             <tr>
                             <td width="30%" align="left">
                             
                           
                            
                             <asp:Button ID="btnCancel" Text="Cancel" style="margin-left:520px;margin-top:2px;" CssClass="btnCommon" Width="74px" Height="24px" runat="server"  OnClick="btnCancel_Click"/> 
                             </td>
                             </tr>
                             
                             
                             <tr>
                                                                     
                           <td align="left">
                           <table width="95%" cellpadding="0" cellspacing="0" style=" border=" 0="><br mode=" hold=" />                      <tr><br mode=" 2=" align=" left="><span id=" page-heading-1-small=">Search Compound</span><br mode=" lblcname=" runat=" server=" Text=" compund="" name="></asp:Label><br mode=" txtcompoundname=" runat=" textbox=" Width=" 130px="  önkeydown=" btncompoundsearch=" runat=" search=" CssClass=" btncommon=" Height=" 27=" Width=" 84="<br mode=" btncompoundsearch_onclick=" /><br mode=" lblexitingusermsg=" runat=" text-orange=" ></asp:Label><br /><br mode=" gvpanelistcompoundlist=" runat=" true=" <br mode=" gridaltitem=" AutoGenerateColumns=" false=" <br mode=" 4=" CssClass=" grid=" DataKeyNames=" compoundid=" <br mode=" horizontal=" HeaderStyle-CssClass=" gridheadertable1=" <br mode=" gvpanelistcompoundlist_pageindexchanging="  Width=" 310px=" <br mode=" right=" PageSize=" 300=" RowStyle-CssClass=" griditem=" ><br mode=" numeric=" Position=" topandbottom=" /><br mode=" compound="" hrfcompoundname=" runat=" hrfcompound_click=" <br mode=" 50px=" /><br mode=" gridpagerstyle=" ForeColor=" black=" <br mode=" center=" /><br mode=" label2=" runat=" label="></asp:Label><br mode=" 0px=" cellspacing=" lbl_certiseq=" runat=" 12=" ForeColor=" white="></asp:Label><br mode=" mpe2=" behaviorID=" modalremoved=" CacheDynamicResults=" pnlmainpopup=" TargetControlID=" tgtctrl_alt2=" CancelControlID=" btncancel=" Enabled=" display:none=" /><br mode=" xmlns:display="#unknown"></table></td></tr></table></div></contenttemplate>

推荐答案

find('ProgressBarModalPopupExtender'); myExtender.show(); 返回 ; } function validation() { var txtmedicinename = document.getElementById('<%= txtmedicinename.ClientID %>'); if (txtmedicinename.value == "" ) { alert("Please enter Medicine Name"); txtmedicinename.focus(); 返回 ; } StartProgressBar(); } < / 脚本 > <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server"> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" ScriptMode="Release"> <table border="0" width="100%"> <tr><td><div id="page-heading-1">Medicine Details</div> </td> < /tr > < tr > < td > <asp:Label ID="lbl_msg" runat="server" Text="" CssClass="orange-bold" Visible="true"></td< /tr > < /table > <table style="margin-removed10px;"> <tr><td style="vertical-align:text-top"><span class="text-orange">*</span> <asp:Label ID="lblmedicinename" runat="server" Text="Medicine Name"></td> < td > <asp:TextBox ID="txtmedicinename" runat="server" Rows="3" TextMode="MultiLine" Width="200px"> < /td > < /tr > < tr > <td><asp:Label ID="lblform" runat="server" Text="Form"></td> <td><asp:TextBox ID="txtform" runat="server" Width="200px" onkeydown="return disableEnterKey(event)"></td> ; < /tr > < tr > <td><asp:Label ID="lblPregnancy" runat="server" Text="Pregnancy"></td> < td > <asp:DropDownList ID="ddlPregnancy" runat="server" Width="200px"> < /td > < /tr > < tr > <td><asp:Label ID="lblLactation" runat="server" Text="Lactation" Width="200px"></td> <td> <asp:DropDownList ID="ddlLactation" runat="server" Width="200px"> < /td > < /tr > < tr > <td><asp:Label ID="lblLabInterference" runat="server" Text="Lab Interference"></td> < td > <asp:RadioButtonList ID="rdLabInterference" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="1">Yes <asp:ListItem Value="0" Selected="True">No < /td > < /tr > < tr > <td><asp:Label ID="lblFoodInterference" runat="server" Text="Food Interference"></td> < td > <asp:RadioButtonList ID="rdFoodInterference" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="1">Yes <asp:ListItem Value="0" Selected="True">No < /td > < /tr > < tr > < td > <asp:Label ID="lblcompound" runat="server" Text="Compound Names"></td> < td > <asp:Button ID="brnaddmore" runat="server" Text="Add More" CssClass="btnCommon" OnClientClick="StartProgressBar();" onclick="brnaddmore_Click" Width="80px" Height="22px"/> < /td > < /tr > < tr > < td =" 2" < asp:UpdatePanel 运行 =" < contenttemplate > <asp:GridView ID="gvcompound" runat="server" span> span> AlternatingRowStyle-CssClass="gridaltitem" AutoGenerateColumns="False" span> CellPadding="4" CssClass="grid" DataKeyNames="CompoundId" span> span> HeaderStyle-CssClass="gridheadertable1" span> onrowdeleting="gvcompound_RowDeleting" span> PagerStyle-HorizontalAlign="Right" PageSize="15" span> RowStyle-CssClass="griditem" onrowdatabound="gvcompound_RowDataBound"> <rowstyle cssclass="griditem" /> < > <asp:BoundField HeaderText="Compound Name" runat="server" DataField="CompoundName"/> <asp:CommandField ShowDeleteButton="True" ButtonType="Button" ControlStyle-CssClass="btnCommon"/> < /列 > < /contenttemplate > < /td > < /tr > <tr><td> </td><td></td></tr> <tr><td></td><td> <asp:Button ID="btnsave" runat="server" Text="Save" CssClass="btnCommon" onclick="btnsave_Click" OnClientClick="return validation();" Width="100px" Height="25px"/></td></tr> < tr > < td =" 2" > ; <asp:ModalPopupExtender ID="ProgressBarModalPopupExtender" runat="server" BackgroundCssClass="ModalBackground_2" behaviorID="ProgressBarModalPopupExtender" TargetControlID="hiddenField" PopupControlID="Panel3" /> <asp:Panel ID="Panel3" runat="server" Style="display: none; background-color: #FFFFFF;"> <img src="../Images/green-loader.gif" alt="Loader" /> <asp:HiddenField ID="hiddenField" runat="server" /></td> < /tr > < /table > <asp:UpdatePanel ID="updpnlforDocPnllist" runat="server"> < 触发器 > <asp:AsyncPostBackTrigger ControlID="brnaddmore" /></triggers> < contenttemplate > <asp:HiddenField ID="hfCompoundID" runat="server" Value="0" /> <asp:Panel ID="pnlMainPopup" runat="server" style=" background-color:Transparent; border-width:medium; width:630px; height:450px;text-align:center; display:none;"> <div style="margin:10px 10px 10px 10px"> <asp:Panel ID="pnlDoctorChildPreveiw" runat="server" Visible="true" ScrollBars="Auto" style="color:Black; background-color:Azure; border-width:medium; vertical-align:middle;width:630px; height:430px;text-align:center;"> <table id="tbl_certi" align="center" style="margin-removed5px;" width="600px" cellpadding="0px" cellspacing="0px" border="0px"> < tr > <td width="30%" align="left"> <asp:Button ID="btnCancel" Text="Cancel" style="margin-left:520px;margin-top:2px;" CssClass="btnCommon" Width="74px" Height="24px" runat="server" OnClick="btnCancel_Click"/> < /td > < /tr > < tr > < td =" 左" <table width="95%" cellpadding="0" cellspacing="0" style=" border=" 0="><br mode=" hold="/> <tr><br mode=" 2=" align=" left="><span id=" page-heading-1-small=">Search Compound</span><br mode=" lblcname=" runat=" server=" Text=" compund="" name="></asp:Label><br mode=" txtcompoundname=" runat=" textbox=" Width=" 130px=" önkeydown=" btncompoundsearch=" runat=" search=" CssClass=" btncommon=" Height=" 27=" Width=" 84="<br mode=" btncompoundsearch_onclick="/><br mode=" lblexitingusermsg=" runat=" text-orange=" ></asp:Label><br/><br mode=" gvpanelistcompoundlist=" runat=" true=" <br mode=" gridaltitem=" AutoGenerateColumns=" false=" <br mode=" 4=" CssClass=" grid=" DataKeyNames=" compoundid=" <br mode=" horizontal=" HeaderStyle-CssClass=" gridheadertable1=" <br mode=" gvpanelistcompoundlist_pageindexchanging=" Width=" 310px=" <br mode=" right=" PageSize=" 300=" RowStyle-CssClass=" griditem=" ><br mode=" numeric=" Position=" topandbottom="/><br mode=" compound="" hrfcompoundname=" runat=" hrfcompound_click=" <br mode=" 50px="/><br mode=" gridpagerstyle=" ForeColor=" black=" <br mode=" center="/><br mode=" label2=" runat=" label="></asp:Label><br mode=" 0px=" cellspacing=" lbl_certiseq=" runat=" 12=" ForeColor=" white="></asp:Label><br mode=" mpe2=" behaviorID=" modalremoved=" CacheDynamicResults=" pnlmainpopup=" TargetControlID=" tgtctrl_alt2=" CancelControlID=" btncancel=" Enabled=" display:none="/><br mode=" xmlns:display="#unknown"></table></td></tr></table></div></contenttemplate>
find('ProgressBarModalPopupExtender'); myExtender.show(); return true; } function validation() { var txtmedicinename = document.getElementById('<%= txtmedicinename.ClientID %>'); if (txtmedicinename.value == "" ) { alert("Please enter Medicine Name"); txtmedicinename.focus(); return false; } StartProgressBar(); } </script> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server"> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" ScriptMode="Release"> <table border="0" width="100%"> <tr><td><div id="page-heading-1">Medicine Details</div> </td> </tr> <tr> <td> <asp:Label ID="lbl_msg" runat="server" Text="" CssClass="orange-bold" Visible="true"></td> </tr> </table> <table style="margin-removed10px;"> <tr><td style="vertical-align:text-top"><span class="text-orange">*</span> <asp:Label ID="lblmedicinename" runat="server" Text="Medicine Name"></td> <td> <asp:TextBox ID="txtmedicinename" runat="server" Rows="3" TextMode="MultiLine" Width="200px"> </td></tr> <tr> <td><asp:Label ID="lblform" runat="server" Text="Form"></td> <td><asp:TextBox ID="txtform" runat="server" Width="200px" onkeydown="return disableEnterKey(event)"></td> </tr> <tr> <td><asp:Label ID="lblPregnancy" runat="server" Text="Pregnancy"></td> <td> <asp:DropDownList ID="ddlPregnancy" runat="server" Width="200px"> </td> </tr> <tr> <td><asp:Label ID="lblLactation" runat="server" Text="Lactation" Width="200px"></td> <td> <asp:DropDownList ID="ddlLactation" runat="server" Width="200px"> </td> </tr> <tr> <td><asp:Label ID="lblLabInterference" runat="server" Text="Lab Interference"></td> <td> <asp:RadioButtonList ID="rdLabInterference" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="1">Yes <asp:ListItem Value="0" Selected="True">No </td> </tr> <tr> <td><asp:Label ID="lblFoodInterference" runat="server" Text="Food Interference"></td> <td> <asp:RadioButtonList ID="rdFoodInterference" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="1">Yes <asp:ListItem Value="0" Selected="True">No </td> </tr> <tr> <td> <asp:Label ID="lblcompound" runat="server" Text="Compound Names"></td> <td> <asp:Button ID="brnaddmore" runat="server" Text="Add More" CssClass="btnCommon" OnClientClick="StartProgressBar();" onclick="brnaddmore_Click" Width="80px" Height="22px"/> </td> </tr> <tr> <td colspan="2"> <asp:UpdatePanel runat="server"> <contenttemplate> <asp:GridView ID="gvcompound" runat="server" AlternatingRowStyle-CssClass="gridaltitem" AutoGenerateColumns="False" CellPadding="4" CssClass="grid" DataKeyNames="CompoundId" HeaderStyle-CssClass="gridheadertable1" onrowdeleting="gvcompound_RowDeleting" PagerStyle-HorizontalAlign="Right" PageSize="15" RowStyle-CssClass="griditem" onrowdatabound="gvcompound_RowDataBound"> <rowstyle cssclass="griditem" /> <columns> <asp:BoundField HeaderText="Compound Name" runat="server" DataField="CompoundName"/> <asp:CommandField ShowDeleteButton="True" ButtonType="Button" ControlStyle-CssClass="btnCommon"/> </columns> </contenttemplate> </td> </tr> <tr><td> </td><td></td></tr> <tr><td></td><td> <asp:Button ID="btnsave" runat="server" Text="Save" CssClass="btnCommon" onclick="btnsave_Click" OnClientClick="return validation();" Width="100px" Height="25px"/></td></tr> <tr><td colspan="2"> <asp:ModalPopupExtender ID="ProgressBarModalPopupExtender" runat="server" BackgroundCssClass="ModalBackground_2" behaviorID="ProgressBarModalPopupExtender" TargetControlID="hiddenField" PopupControlID="Panel3" /> <asp:Panel ID="Panel3" runat="server" Style="display: none; background-color: #FFFFFF;"> <img src="../Images/green-loader.gif" alt="Loader" /> <asp:HiddenField ID="hiddenField" runat="server" /></td> </tr> </table> <asp:UpdatePanel ID="updpnlforDocPnllist" runat="server"> <triggers> <asp:AsyncPostBackTrigger ControlID="brnaddmore" /></triggers> <contenttemplate> <asp:HiddenField ID="hfCompoundID" runat="server" Value="0" /> <asp:Panel ID="pnlMainPopup" runat="server" style=" background-color:Transparent; border-width:medium; width:630px; height:450px;text-align:center; display:none;"> <div style="margin:10px 10px 10px 10px"> <asp:Panel ID="pnlDoctorChildPreveiw" runat="server" Visible="true" ScrollBars="Auto" style="color:Black; background-color:Azure; border-width:medium; vertical-align:middle;width:630px; height:430px;text-align:center;"> <table id="tbl_certi" align="center" style="margin-removed5px;" width="600px" cellpadding="0px" cellspacing="0px" border="0px"> <tr> <td width="30%" align="left"> <asp:Button ID="btnCancel" Text="Cancel" style="margin-left:520px;margin-top:2px;" CssClass="btnCommon" Width="74px" Height="24px" runat="server" OnClick="btnCancel_Click"/> </td> </tr> <tr> <td align="left"> <table width="95%" cellpadding="0" cellspacing="0" style=" border=" 0="><br mode=" hold=" /> <tr><br mode=" 2=" align=" left="><span id=" page-heading-1-small=">Search Compound</span><br mode=" lblcname=" runat=" server=" Text=" compund="" name="></asp:Label><br mode=" txtcompoundname=" runat=" textbox=" Width=" 130px=" önkeydown=" btncompoundsearch=" runat=" search=" CssClass=" btncommon=" Height=" 27=" Width=" 84="<br mode=" btncompoundsearch_onclick=" /><br mode=" lblexitingusermsg=" runat=" text-orange=" ></asp:Label><br /><br mode=" gvpanelistcompoundlist=" runat=" true=" <br mode=" gridaltitem=" AutoGenerateColumns=" false=" <br mode=" 4=" CssClass=" grid=" DataKeyNames=" compoundid=" <br mode=" horizontal=" HeaderStyle-CssClass=" gridheadertable1=" <br mode=" gvpanelistcompoundlist_pageindexchanging=" Width=" 310px=" <br mode=" right=" PageSize=" 300=" RowStyle-CssClass=" griditem=" ><br mode=" numeric=" Position=" topandbottom=" /><br mode=" compound="" hrfcompoundname=" runat=" hrfcompound_click=" <br mode=" 50px=" /><br mode=" gridpagerstyle=" ForeColor=" black=" <br mode=" center=" /><br mode=" label2=" runat=" label="></asp:Label><br mode=" 0px=" cellspacing=" lbl_certiseq=" runat=" 12=" ForeColor=" white="></asp:Label><br mode=" mpe2=" behaviorID=" modalremoved=" CacheDynamicResults=" pnlmainpopup=" TargetControlID=" tgtctrl_alt2=" CancelControlID=" btncancel=" Enabled=" display:none=" /><br mode=" xmlns:display="#unknown"></table></td></tr></table></div></contenttemplate>


这篇关于无法解决该错误"_backgroundElement.parentNode"为空或不是对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆