how to call javascript from asp .net c# script ?

Discussion in 'ASP .Net' started by lee, Aug 5, 2003.

  1. lee

    lee Guest

    If a certain criteria happens with some data how do I show a
    javascript message box to notify the user ?

    I don't think I can use a validator control as it's not applicable.


    <SCRIPT LANGUAGE="JavaScript">
    function onClickJS()
    {
    window.confirm("data malformed");
    }
    </SCRIPT>


    Thanks,
    Hobnob.
     
    lee, Aug 5, 2003
    #1
    1. Advertising

  2. Lee,

    You may want to make the Body tag into a server control and attach the
    javascript to that.

    I have some sample code on my website, www.aboutfortunate.com, which will
    show you how to do so. It's in VB, but it's very simple. You should be able
    to port it over without a problem, but if you have questions feel free to
    email me. Just search the code library on the site for: "use the body tag as
    a server control" or something similar to that and it should pop up as the
    first hit.

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche
    "lee" <> wrote in message
    news:...
    > If a certain criteria happens with some data how do I show a
    > javascript message box to notify the user ?
    >
    > I don't think I can use a validator control as it's not applicable.
    >
    >
    > <SCRIPT LANGUAGE="JavaScript">
    > function onClickJS()
    > {
    > window.confirm("data malformed");
    > }
    > </SCRIPT>
    >
    >
    > Thanks,
    > Hobnob.
     
    S. Justin Gengo, Aug 5, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wet Basement
    Replies:
    1
    Views:
    2,593
    BobMonk
    Jul 15, 2003
  2. Karim Ali
    Replies:
    1
    Views:
    299
    James Stroud
    May 24, 2007
  3. Fabio Mastria
    Replies:
    4
    Views:
    756
    Fabio Mastria
    Jan 28, 2008
  4. I like to party
    Replies:
    10
    Views:
    1,443
    Michel Posseth [MCP]
    Sep 17, 2009
  5. Blue®
    Replies:
    10
    Views:
    334
    Thomas 'PointedEars' Lahn
    May 27, 2005
Loading...

Share This Page