asp:dropdown call client side javascript on event?

Discussion in 'ASP .Net' started by soni2926@yahoo.com, Nov 28, 2007.

  1. Guest

    hi,
    i have a asp:dropwdown list on my page, it's populated with data (via
    a dataset) on page_load. when a user selects a choice i want to call
    a javascript function, is this possible? to have a client side event
    called by a server control?

    Thanks.
     
    , Nov 28, 2007
    #1
    1. Advertising

  2. Wannabe Guest

    yes...you can attach a onchange event to the dropdown, in the code behind page:

    ddTitle.Attributes.Add("onclick", "MyJavascriptCall()");

    or

    add onclick on the HTML page, with the name of the javascript function.



    "" wrote:

    > hi,
    > i have a asp:dropwdown list on my page, it's populated with data (via
    > a dataset) on page_load. when a user selects a choice i want to call
    > a javascript function, is this possible? to have a client side event
    > called by a server control?
    >
    > Thanks.
    >
     
    Wannabe, Nov 28, 2007
    #2
    1. Advertising

  3. You must have meant

    ddTitle.Attributes.Add("onchange", "MyJavascriptCall()");

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "Wannabe" <> wrote in message
    news:...
    > yes...you can attach a onchange event to the dropdown, in the code behind
    > page:
    >
    > ddTitle.Attributes.Add("onclick", "MyJavascriptCall()");
    >
    > or
    >
    > add onclick on the HTML page, with the name of the javascript function.
    >
    >
    >
    > "" wrote:
    >
    >> hi,
    >> i have a asp:dropwdown list on my page, it's populated with data (via
    >> a dataset) on page_load. when a user selects a choice i want to call
    >> a javascript function, is this possible? to have a client side event
    >> called by a server control?
    >>
    >> Thanks.
    >>
     
    Eliyahu Goldin, Nov 29, 2007
    #3
    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. =?Utf-8?B?bGFuZW0=?=
    Replies:
    3
    Views:
    29,361
    Eliyahu Goldin
    Mar 30, 2005
  2. Replies:
    5
    Views:
    21,187
    hellobiswa2001
    Aug 27, 2009
  3. Simon
    Replies:
    5
    Views:
    820
    Steven Cheng [MSFT]
    Apr 30, 2008
  4. Guest

    Fire server side event before client side event

    Guest, Mar 17, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    628
    Ken Cox [Microsoft MVP]
    Mar 18, 2005
  5. David Shorthouse

    server-side vbscript call with javascript client-side

    David Shorthouse, Feb 2, 2005, in forum: ASP General
    Replies:
    2
    Views:
    378
    Mark Schupp
    Feb 3, 2005
Loading...

Share This Page