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

what event do i use?

0 views
Skip to first unread message

rodchar

unread,
Oct 11, 2007, 11:53:06 AM10/11/07
to
hey all,
i have a gridview on my web page. when i click to select a row and then
click edit to go into edit mode, as soon as i'm in edit mode i need to run a
javascript function. what's the best way to attach my function?

thanks,
rodchar

Alexander Myachin

unread,
Oct 12, 2007, 5:36:14 AM10/12/07
to
Rodchar,

You can try something like this:

// Grid.RowCommand event handler
void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if ( e.CommandName = "Edit")
{
// Grid is not in edit mode yet Fields from Edit template are
not loaded .
RegisteeRowEditScript();
}

}

void RegisteeRowEditScript()
{
string script = "alert('User clicked Edit');";
Page.ClientScript.RegisterStartupScript(GetType(), 'editclicked',
script, true );
}


"rodchar" <rod...@discussions.microsoft.com> wrote in message
news:6EE48418-6A24-4108...@microsoft.com...

rodchar

unread,
Oct 12, 2007, 8:40:01 AM10/12/07
to
thank you very much this helped.
rod.
0 new messages