.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Melody Anderson
Eminent IT
Post New Web Links

'element.className' is null or not an object

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net


I just downloaded the project, compiled it and ran it right out of the box and when I put the mouse pointer over or remove the mouse pointer from either MenuItem in the menu demo, I generate this error:

'element.className' is null or not an object

It points to this javascript method:

updateClassName: function(operation, element, name, value) {
        this[operation + 'String'](
                function() {
                    return element.className;
                function(newValue) {
                    element.className = newValue;

View Complete Post

More Related Resource Links

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


Hi friends,

        I got This Error : Microsoft JScript runtime error: 'Parent' is null or not an object

 In runtime,after  click on the check box, It Show "Microsoft JScript runtime error: 'Parent' is null or not an object"

<script language ="javascript" type ="text/javascript" >
        function SelectAllCheckboxesSpecific(spanChk)
           var IsChecked = spanChk.checked;
           var items=0;
           var Chk = spanChk;
              Parent = document.getElementById('gvUsers');          
              var items = Parent.getElementsByTagName('input');                         
              for(var i=0;i<items.length;i++)
                  if(items[i].id != Chk && items[i].type=="checkbox")
                      if(items[i].checked!= IsChecked)

please verify it. 

Null Reference Exception was not handled by user Object Reference not set to instance of an object

using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Security.Principal;using System.Data;using System.Data.SqlClient;using System.Windows;using System.Collections; public partial class Default2 : System.Web.UI.Page{    protected void Page_Load(object sender, EventArgs e)    {     }    private bool tableCopied = false;    private DataTable originalDataTable;     protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)    {         if (e.Row.RowType == DataControlRowType.DataRow)        {            //string sValue = e.Row.Cells[3].Text;             if (!tableCopied)            {                originalDataTable = ((System.Data.DataRowView)e.Row.DataItem).Row.Table.Copy();                ViewState["originalDataTable"] = originalDataTable;      &nbs

Javascript "Undefined is null or not an object" error in IE :S

I read around and tried everything to figure out the reason of the issue i'm getting, but i give up, the error i'm getting is only on IE and it's the "Undefined is null or not an object" error.This is it:Line: 29Char: 13Error: 'undefined' is null or not an objectCode: 0This is the script:<script type="text/javascript">    function checkV1() {        if (document.getElementById('CB1').checked)            ValidatorEnable(document.getElementById('CheckBoxListValidator1'), true);        else            ValidatorEnable(document.getElementById('CheckBoxListValidator1'), false);    }    function checkV2() {        if (document.getElementById('CB2').checked)            ValidatorEnable(document.getElementById('CheckBoxListValidator2'), true);        else            ValidatorEnable(document.getElementById('CheckBoxListValidator2'), false);    }THIS IS LINE 29---->    fun

Null Request object in Controller

I have a need to display user-specific information in my master page.  As a result, I have set up all of my controllers to be inherited from a "master" controller.  This has worked well for other aspects of the master page, such as displaying random quotes.  However, while using this technique to incorporate the user-specific information, I ran into a problem where, when I check the Request.IsAuthenticated value, the Request object is null. Here is my "master" controller:namespace MetalMine.Controllers { using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using MyApp.Models; public abstract class ApplicationController : Controller { private DataContext dataContext = new DataContext(); { ViewData["Quote"] = this.dataContext.GetRandomQuote(); // this is where the Request object is null if (this.Request.IsAuthenticated) { // the User object, here, is also null, BTW ViewData["User"] = this.dataContext.GetUser(this.User.Identity.Name); } } } } Curiously - at least to me - is that the Request object becomes populated by the time program flow hits the Home Controller:namespace MetalMine.Controllers { [HandleError] publ

'null' is null or not an object - DragPanelExtender

Ok, I've been banging my head for hours with this... I have a bunch of ajax controls on my aspx page: a dragpanel and a few accordions. The dragpanel has dynamic content (an image) and appears (visible = true) upon clicking on the link buttons listed in the accordions (no update panel used). On page postback, when one of the buttons is clicked, the drag panel pops up and is positioned over another larger image. Here's what the code looks like:<asp:Panel ID="MyHandle" runat="server" Visible="false"> </asp:Panel> <asp:Panel ID="odragpanel" runat="server" Visible="false"> <asp:Image ID="myoimage" runat="server" ImageUrl="" /> </asp:Panel> <ajaxToolkit:DragPanelExtender ID="DragPanelExtender1" runat="server" DragHandleID="MyHandle" Enabled="false" TargetControlID="odragpanel" BehaviorID="myodragpanel"> </ajaxToolkit:DragPanelExtender> When a user selects a link button from the accordion, the visible properties are set to "true" and the drag panel extender is enabled. This is the next block of code that runs on client side:<script type="text/javascript"> jQuery.noConflict(); window.onload = function() { positionm

'this.get_element().style' is null or not an object

I've been getting this error message fairly often. A page will work normaly for a while, but eventualy I get the error: 'this.get_element().style' is null or not an object  Once I get the error it seems to happen most of the time. It seems like it might be from the update progress control.   Any ideas? -A    

Persistant Status Bar Notification ... error 'SP.UI.Status' is null or not an object

I want to show a status bar that needs to be persistent on a page. for this I used the following in my master page function ShowStatusBarMessage(title, message) { var statusId = SP.UI.Status.addStatus(title, message, true); SP.UI.Status.setStatusPriColor(statusId, 'yellow'); /* Set a status-color */ } HTML, call the JS method: <a onclick="ShowStatusBarMessage('Title'!','Awesome message!')"> Display Status Bar message! </a> ref: http://www.zimmergren.net/archive/2010/03/17/sp-2010-dynamically-displaying-messages-to-your-users-with-the-notification-and-status-bar-areas-in-sharepoint-2010.aspx   But what I want is to call the function on load. So I used pushed ny function to _spBodyOnLoadWrapper using _spBodyOnLoadFunctionNames.push("YourFunctionName");, it throws an error 'SP.UI.Status' is null or not an object Next I created and deployed a webcontrol and did a registerclientscript, that too gives me 'SP.UI.Status' is null or not an object // Define the name and type of the client scripts on the page. String csname1 = "AlertScript"; Type cstype = this.GetType(); // Get a ClientScriptManager reference from the Page class. ClientScriptManager cs = Page.ClientScript; // Check to see if the startup script is already registered. if (!cs.IsStartupScriptRegistered(cstype, csname1)) {

Javasript error 'this.get_element() is null or not an object'

While testing an AJAX enabled web app I sometimes stumbled upon this script error: 'this.get_element().style' is null or not an object. It was a hard nut to crack this one.This was the actual message 'this.get_element() is null or not an object' The situation: AJAX Enabled web app using slider extenders . In some circumstances a script error is generated. In most cases it is not. The reason:It turned out that the error happens at times when a new Postback is triggered while a previous one hasnt finished yet. That is quickly changing the sliderhandle's position in this scenario. The Postback where triggered because i had set the AutoPostBack property of the extended TextBox to "true".I have some code running inside the event handler . Can anyone suggest an efficient solution for this problem ........................................................?  

'document.getElementById(...)' is null or not an object


i am making use of the following javascript at page_load event, to fill the default value of textbox, txtBuinessUserMailID at run time:

 void Page_Load(object sender, EventArgs e)//Initialize a stringbuilder object, much faster than string concatenation


Message: '_onSubmitStatements' is null or not an object



I am getting this error:

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Wed, 22 Sep 2010 16:29:25 UTC

Message: '_onSubmitStatements' is null or not an object
Line: 139
Char: 1
Code: 0
URI: http://localhost/ScriptResource.axd?d=tZ3JCSii4EBM-tx4hEokGcwHyUFbgrEZpCEYoSnucLTc6JYWo2bAUxru-077QmJamzQWn-57TS-gCWMEOCyeIodqSlLvi4Ux0&t=634057278000000000

in my application for a module that displays detailed data in a tab control. I think I have determined the TabContainer1 is the name of the "This" element that is having the issue. I figured this out by debugging the ScriptResource.axd file. Here is the offending lines of code:

Line# 138 = if (typeof(Sys.WebForms)!=="undefined" && typeof(Sys.WebForms.PageRequestManager)!=="undefined") {
Line# 139 = Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, this._onsubmit$delegate);} else {
Line# 140 = $addHandler(document.forms[0], "submit", this._onsubmit$delegate);}
Line# 141 = }

The way the app works is there are two modules that work together on the page. One is

How to get nodes based on some values, update other element or delete that whole object



This is my xml string.

<xml version="1.0" encoding="utf-16">
    <x> test value 1 </x>
    <y> test value 2</y>

        <x> test value 3</x>
        <y> test value 4</y>

                <x> test value 5</x>
                <y> test value 6 </y>

                <x> test value 7</x>
                <y> test value 8 </y>

                    <x> test value 9</x>
                    <y> test value 6</y>







I have a big xml same as above containing a deep hierarchy.

Now, I am looking to do two things.

1. I want to find a particular node/obj by checking <x> element value. so I want to get node ofwhich <x> value is "test value 3" and for that object, I want to update <y> value to "Some New Value".

2. I want to find all the nodes/objects by checking <y> element value is "test value 6" OR "test value 8" OR "test value

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


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

in jquery-1.4.2.min.js 

Error: 'nextElement' is null or not an object when asyncrendering = false

I upgraded 2005 reports to 2008 and updated the corresponding report viewer control in the Web site. Now some reports throw JavaScript errors when AsyncRendering=False. I can't set AsyncRndering to true since that introduces other problems.

Does anyone know what the issues are with upgrading the Report Viewer control form 8 to 9 with this AsyncRendering attribute?

The goal with that attribute is so the browser doesn't have two scrollbars. With that attribute set to true the result is a report with scrollbars inside of a Web page with scrollbars.

IE7 Only "system.extended.ui null or not object"



I am seeing a strange error when using the Ajax Control Toolkit, specifically the AutoCompleteExtender. I recieve a message that says "system.extended.ui is null or not an object". This DOES NOT OCCUR in IE6 of FF 3.5, just in IE7.

Any idea why this would be happening in just one browser? I have written no custom Javascript on the page, the only JS is that provided by the AutoCompleteExtender.

Help and or suggestions would be much appreciated.


_events is null or not an object only after setting compile debug="false"



I have been running an application in debug mode for awhile, and am ready to launch it to production.  The application which uses ASP.Net AJAX controls pretty heavily, works fine when the Web.Config value is:

<compilation debug="true">

However, once I change the value to:

<compilation debug="false">

The application starts throwing errors whenever I click on something that would fire an AJAX update event in my application.  The error is:

Webpage error details

Message: '_events' is null or not an object
Line: 5
Char: 36005

As soon as I set debug="true" again, everything works as it should.

Any ideas?

Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object



I have one text box and that textbox should contain firstname.lastname.

I am doing Client side validation.

I am getting error Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object.

ASPX code :-

function validateTextBox(str)
         alert(str);// Getting proper value
        if (str.indexOf(".") == -1)
                alert("Username should have period(.) between firstName and LastName like FirstName.LastName or FirstNameMI.LastName");
               // Here i am getting error...
                return false;

Convert XML to object returns null due to unwanted string


Hello All,

I am facing very odd problem, when I check my xml string than in header it contain one unwanted string square [], like below, due to that casting to object is not happening. Due to that it returns null

[]<?xml version="1.0"?>

But when I remove [] and convert to object then it works fine. Any one has any idea.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend