Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Writing Client Scripts in PostBack

1 view
Skip to first unread message

Rafael Veronezi

unread,
Sep 23, 2003, 9:59:14 AM9/23/03
to
I have the following situation...
I need to display a MessageBox after a postback...
When the user click a button on the page, the event will do it's work, and
after that will write the client script (jscript) with the code to display
the MessageBox...
I don't know if it works well with Response.Write, because one of the codes
I need to write is a ask of printing, and the Response.Write render the code
before the rest of code of the page, so the script would work, but print
nothing...


Micke

unread,
Sep 23, 2003, 10:28:01 AM9/23/03
to
I'm simply using Page.RegisterClientScriptBlock in the event procedure, if
that's what you are after?

private void DropDownList1_SelectedIndexChanged(..)
{
//.. other code

Page.RegisterClientScriptBlock("clientscript","<script
language=javascript>alert('Hello, world!'); </script>");
}

Watch out for line breaks ;/ Anyway, this in a _OnClick event procedure
would work as well.
/Micke

"Rafael Veronezi" <raf...@dmweb.com.br> wrote in message
news:eIFypqdg...@TK2MSFTNGP09.phx.gbl...

Jurjen de Groot

unread,
Sep 23, 2003, 10:43:54 AM9/23/03
to
Check out :

RegisterClientScriptBlock

Jurjen.


"Rafael Veronezi" <raf...@dmweb.com.br> wrote in message
news:eIFypqdg...@TK2MSFTNGP09.phx.gbl...

0 new messages