Server-side, then client.

G

gsauns

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.
 
M

Mark Rae

gsauns said:
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);
}
}
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top