Results 1 to 7 of 7

Thread: Javascript in ASP.NET

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2004
    Location
    India
    Posts
    53

    Javascript in ASP.NET

    hi everyone,

    i m trying to use javascript functions in asp.net webform...but somehow, the click function which should check the textbox status is not recognising the javascript functions

    is there any difference in using javascript in ASP and javascript in ASP.NET

    thnx
    Yash

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: Javascript in ASP.NET

    No, javascript is javascript.

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2004
    Location
    India
    Posts
    53

    Re: Javascript in ASP.NET

    i know javascript is javascript...but in asp we used to write onclick="function_name()...but in asp.net we cant do that.

    can u plz suggest any wayout for this.
    Yash

  4. #4
    New Member munchkin's Avatar
    Join Date
    Apr 2005
    Location
    England, UK
    Posts
    6

    Re: Javascript in ASP.NET

    if you are using an <asp:textbox /> i dont think that they have an onClick="" attrib... this does however seem a tad strange..

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: Javascript in ASP.NET

    you can still apply an onclick attribute to a textbox, just do it on the code behind.

  6. #6
    Member CommanderEl's Avatar
    Join Date
    Feb 2005
    Location
    Adelaide, Australia
    Posts
    40

    Re: Javascript in ASP.NET

    example?

  7. #7
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: Javascript in ASP.NET

    Code:
    textBox1.Attributes.Add("onclick","alert('hi');");

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width