Server-side, then client.

Discussion in 'ASP .Net' started by gsauns, Apr 29, 2007.

  1. gsauns

    gsauns Guest

    Is it possible to, on a click of a button, run server-side code, and
    then, upon page refresh, run a client-side Javascript function?
    The client-side code would run only when the page was refreshed by
    that particular button.
     
    gsauns, Apr 29, 2007
    #1
    1. Advertising

  2. gsauns

    Mark Rae Guest

    "gsauns" <> wrote in message
    news:...
    > Is it possible to, on a click of a button, run server-side code, and
    > then, upon page refresh, run a client-side Javascript function?
    > The client-side code would run only when the page was refreshed by
    > that particular button.
    >



    protected void MyButton_Click(object sender, EventArgs e)
    {
    if (<...evaulate some condition...)
    {
    ClientScript.RegisterStartupScript(GetType(), "clientside",
    "alert('Hello);", true);
    }
    }

    --
    http://www.markrae.net
     
    Mark Rae, Apr 29, 2007
    #2
    1. Advertising

  3. This article may help you:

    How to Pass Messages and Actions between Server and Client
    http://usableasp.net/DeveloperPage....o/HowToPassMessagesBetweenServerAndClient.htm
    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin


    "gsauns" <> wrote in message
    news:...
    > Is it possible to, on a click of a button, run server-side code, and
    > then, upon page refresh, run a client-side Javascript function?
    > The client-side code would run only when the page was refreshed by
    > that particular button.
    >
     
    Eliyahu Goldin, Apr 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. Mortar
    Replies:
    4
    Views:
    2,253
    Mortar
    Jan 25, 2005
  2. Replies:
    0
    Views:
    445
  3. Replies:
    1
    Views:
    6,296
  4. Replies:
    0
    Views:
    298
  5. Replies:
    0
    Views:
    166
Loading...

Share This Page