o anche

this.registerstartupscript("pippo","<script>....</script>");

chiaramente nell'evento del pulsante.