Error: Object Expected

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • avanti

    Error: Object Expected

    HI,

    I have an ASP page with some Javascript code. The JS has several
    functions and only some of them work. Here is part of the code:

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server" id="Head1">
    <title>Title</title>
    <Ctrl:styleshee ts id="Css1" runat="server" />
    <script language="javas cript" type="text/javascript">
    function SetSecurityCode ()
    {
    Alert("Hello");
    }
    </script>

    .............

    <CoreCtrl:Contr ols.WebControls .HyperLink id="CodeLink" Text="Set
    Value" CssClass="textS mall" OnClick="SetSec urityCode();" Href="#"
    runat="server" />

    I am seeing Error:Object Expected on the alert line in the JS function.
    Some other functions inside the script work as expected.

    Any clues?

    Thanks,
    Avanti

  • gautam.verma@gmail.com

    #2
    Re: Error: Object Expected

    try changing Alert("Hello"); to alert("hello");

    -Gautam

    avanti wrote:
    HI,
    >
    I have an ASP page with some Javascript code. The JS has several
    functions and only some of them work. Here is part of the code:
    >
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server" id="Head1">
    <title>Title</title>
    <Ctrl:styleshee ts id="Css1" runat="server" />
    <script language="javas cript" type="text/javascript">
    function SetSecurityCode ()
    {
    Alert("Hello");
    }
    </script>
    >
    .............
    >
    <CoreCtrl:Contr ols.WebControls .HyperLink id="CodeLink" Text="Set
    Value" CssClass="textS mall" OnClick="SetSec urityCode();" Href="#"
    runat="server" />
    >
    I am seeing Error:Object Expected on the alert line in the JS function.
    Some other functions inside the script work as expected.
    >
    Any clues?
    >
    Thanks,
    Avanti

    Comment

    Working...