Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:20:07+00:00 2026-06-14T18:20:07+00:00

I have created two views using multiview option. Now during runtime, I’m getting this

  • 0

I have created two views using multiview option. Now during runtime, I’m getting this error:

Microsoft JScript runtime error: 'null' is null or not an object

for for this code:

window.onload = function checkbox(check) {
var check = document.getElementById("<%=cbxAuth.ClientID %>"); //<- error from here
check.onchange = function checkbox(check) {
  if (this.checked == true)
   {
    document.getElementById("<%=txtUsName.ClientID %>").disabled = false;
    document.getElementById("<%=txtPassword.ClientID %>").disabled = false;
   }
  else
   {
    document.getElementById("<%=txtUsName.ClientID %>").disabled = true;
    document.getElementById("<%=txtPassword.ClientID %>").disabled = true;
   }
 }; // Till here
};

Now when I analysed the code at dynamic, I realized that this is in my second view and the entire code is not present at the dynamic runtime.

This is my front-end code for creating views:

 <td>
 <asp:Button Text="Generate License" BorderStyle="None" ID="Tab1" CssClass="Initial"
  runat="server" OnClick="Tab1_Click" ValidationGroup="generatelicence" />
 <asp:Button Text="Mail Configuration" BorderStyle="None" ID="Tab2" CssClass="Initial"
   runat="server" OnClick="Tab2_Click" ValidationGroup="sendemail" />
 <asp:MultiView ID="MainView" runat="server">

This is the code while I create the second view:

<asp:View ID="View2" runat="server">
             <table style="width: 100%; border-width: 1px; border-color: #666; border-style: solid">
                 <tr>
                     <td class="style15">
                         FROM
                     </td>
                     <td>
                         <asp:TextBox ID="txtFrom" runat="server" Width="414px" CssClass="Textbox1"></asp:TextBox>
                         <asp:LinkButton ID="lbEdit0" runat="server" onclick="lbEdit0_Click"> Edit </asp:LinkButton>
                         <asp:RegularExpressionValidator ID="regexSendFrom" runat="server" ControlToValidate="txtFrom"
                             ErrorMessage="Enter a Valid Name" ValidationExpression="\w+([\s-_]\w+)*" ValidationGroup="sendemail"></asp:RegularExpressionValidator>
                     </td>
                 </tr>
                 <tr>
                     <td class="style15">
                         SENDER MAIL</td>
                     <td>
                         <asp:TextBox ID="txtMailAdd" runat="server" Width="414px" CssClass="Textbox1"></asp:TextBox>
                         <asp:LinkButton ID="lbEdit1" runat="server" onclick="lbEdit1_Click"> Edit
                         </asp:LinkButton>
                         <asp:RegularExpressionValidator ID="regexSender" runat="server" 
                             ControlToValidate="txtMailAdd" ErrorMessage="Incorrect Mailing Address" 
                             ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                             ValidationGroup="sendemail"></asp:RegularExpressionValidator>
                     </td>
                 </tr>
                 <tr>
                     <td class="style15">
                         SMTP IP
                     </td>
                     <td>
                         <asp:TextBox ID="txtSMTP" runat="server" Width="414px" CssClass="Textbox1"></asp:TextBox>
                         <asp:LinkButton ID="lbEdit2" runat="server" onclick="lbEdit2_Click"> Edit
                         </asp:LinkButton>
                         <asp:RegularExpressionValidator ID="regexSMTP" runat="server" 
                             ControlToValidate="txtSMTP" ErrorMessage="IP Address is Incorrect" 
                             ValidationExpression="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" 
                             ValidationGroup="sendemail"></asp:RegularExpressionValidator>
                     </td>
                 </tr>
                 <tr>
                     <td class="style15">
                         SMTP AUTHENTICATION
                     </td>
                     <td>
                         <asp:CheckBox ID="cbxAuth" runat="server" />
                     </td>
                 </tr>
                 <tr>
                     <td class="style16">
                         &nbsp;
                     </td>
                     <td class="style11">
                         User Name&nbsp;
                         <asp:TextBox ID="txtUsName" runat="server" Enabled="false" Width="299px" CssClass="Textbox1"></asp:TextBox>
                         <asp:LinkButton ID="lbEdit3" runat="server" OnClick="lbEdit3_Click"> Edit
                         </asp:LinkButton>
                         <br />
                         Password&nbsp;&nbsp;&nbsp;
                         <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" Width="300px" Enabled="false"
                             CssClass="Textbox1"></asp:TextBox>
                         <asp:LinkButton ID="lbEdit4" runat="server" OnClick="lbEdit4_Click"> Edit
                         </asp:LinkButton>
                         <asp:RequiredFieldValidator ID="reqPass" runat="server" ControlToValidate="txtPassword"
                             Display="Dynamic" ErrorMessage="Enter a Password" ValidationGroup="sendemail"></asp:RequiredFieldValidator>
                         &nbsp;<asp:RequiredFieldValidator ID="reqUserMail" runat="server" ControlToValidate="txtUsName"
                             Display="Dynamic" ErrorMessage="Enter a User Name" ValidationGroup="sendemail"></asp:RequiredFieldValidator>
                         &nbsp;
                     </td>
                 </tr>
                 <tr>
                 <td class="style15"> RECEIVER </td>
                 <td> <asp:TextBox ID="txtReceiver" runat="server" CssClass="Textbox1" Width="414px"></asp:TextBox>
                 <asp:LinkButton ID="lbEdit5" runat="server" OnClick="lbEdit5_Click"> Edit </asp:LinkButton>
                 </td>

                 </tr>
                 <tr>
                     <td class="style15">
                         TO MAIL
                     </td>
                     <td>
                         <asp:TextBox ID="txtTo" runat="server" CssClass="Textbox1" Width="414px"></asp:TextBox>
                         <asp:LinkButton ID="lbEdit6" runat="server" OnClick="lbEdit6_Click"> Edit
                         </asp:LinkButton>
                         <asp:RegularExpressionValidator ID="regexTo" runat="server" 
                             ControlToValidate="txtTo" Display="Dynamic" ErrorMessage="Enter an E-Mail Address" 
                             ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                         <asp:RequiredFieldValidator ID="reqMailTo" runat="server" 
                             ControlToValidate="txtTo" ErrorMessage="Enter a Mailing Address"></asp:RequiredFieldValidator>
                     </td>
                 </tr>
                 <tr>
                     <td class="style15">
                         SUBJECT
                     </td>
                     <td class="style11">
                         <asp:TextBox ID="txtSub" runat="server" Width="414px" CssClass="Textbox1"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="style15">
                         CONTENT
                     </td>
                     <td>
                         <asp:TextBox ID="txtBody" runat="server" Width="414px" CssClass="Textbox1" Columns="10"
                             Rows="10" TextMode="MultiLine"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="style16">
                         ATTACHMENT
                     </td>
                     <td>
                         <asp:FileUpload ID="fupAttach" runat="server" CssClass="Textbox1" 
                             Width="414px" />
                     </td>
                 </tr>
                 <tr>
                     <td colspan="2">
                         &nbsp; &nbsp;
                     </td>
                 </tr>
                 <tr>
                     <td colspan="2">
                         &nbsp;&nbsp;
                     </td>
                 </tr>
                 <tr>
                     <td colspan="2">
                            <tr>
                                <td colspan="2" style="margin-left: 40px" align="center">
                                    <asp:Label ID="lblMailFail" runat="server" ForeColor="Red"></asp:Label>
                                </td>
                            </tr>
                     </td>
                 </tr>
                 <tr>
                     <td colspan="2" align="center" class="style12" style="margin-left: 500px">
                         <asp:Button ID="btnSMail" runat="server" CssClass="btn" Text="Send" 
                             onclick="btnSMail_Click" />
                         &nbsp;<asp:Button ID="btnCancelMail" runat="server" CssClass="btn" Text="Cancel" />
                     </td>
                 </tr>
                 <tr>
                     <td colspan="2">
                         &nbsp;
                     </td>
                 </tr>
             </table>
         </asp:View>

Any good reason why is this happening?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:20:08+00:00Added an answer on June 14, 2026 at 6:20 pm

    On one hand you are passing check as a parameter in checkbox(check) function for event onload and again defining the check on this line:

    var check = document.getElementById("cbxAuth"); //<- error from this line
    

    In addition, why don’t you specify some different meaningful function names for events onload and onchange.

    ADDED, after the question edit with markup, the cbxAuth is a Server Control so you need to get its ClientID for getting its reference in JavaScript. This way:

    var chkbox = document.getElementById("<%= cbxAuth.ClientID %>");
    

    For the other part simple change the function names to some meaningful names as explained earlier.

    window.onload = function OnWindowLoad(check) {
        var chkbox = document.getElementById("<%= cbxAuth.ClientID %>");
        if (chkbox)
        {
            chkbox.onchange = function OnCheckBoxChange(chkbox) {
                // ... rest of your code
            }; 
        }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an alert view with two buttons using the following code: UIAlertView
I have a multiview application using a tab bar to switch views. One is
I have created a web application in mvc3 and created two partial views one
I have created a web application in mvc3 and created two partial views one
I have created two imageViews promatically as shown below: public void createImageViews(Integer count){ ImageView[]
I have created two WindowSurface (WPF), and I want to navigate betwen them. I've
I have created two tables & inserted values as shown below . Table 1
I have created two Pages Page1.xaml and Page2.xaml in windows8 metro apps. I have
I have created two DbContexts, one is for application configuration, the second is for
I have created two folders layout and layout-land with two xml files, one for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.