PC Review


Reply
Thread Tools Rate Thread

Assign confirm when doing GetPostBackClientHyperLink on a gridview

 
 
tiptechno
Guest
Posts: n/a
 
      5th Mar 2008
hello,

i was wondering how to attach a js confirm to the following command

e.Row.Cells[3].Attributes["onclick"] =
Page.ClientScript.GetPostBackClientHyperlink(this.gvGrid, "MyCommand$" +
"value123");

.... I have this in the RowDataBound of the GridView, it works fine, just
want to attach a js confirmation to it so it can be cancelled before posting
back.

thanks...
 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      5th Mar 2008
try:

e.Row.Cells[3].Attributes["onclick"] = "if (!confirm('do it?')) return
false;" +
Page.ClientScript.GetPostBackClientHyperlink(this.gvGrid, "MyCommand$"
+
"value123");



-- bruce (sqlwork.com)


"tiptechno" wrote:

> hello,
>
> i was wondering how to attach a js confirm to the following command
>
> e.Row.Cells[3].Attributes["onclick"] =
> Page.ClientScript.GetPostBackClientHyperlink(this.gvGrid, "MyCommand$" +
> "value123");
>
> ... I have this in the RowDataBound of the GridView, it works fine, just
> want to attach a js confirmation to it so it can be cancelled before posting
> back.
>
> thanks...

 
Reply With Quote
 
tiptechno
Guest
Posts: n/a
 
      6th Mar 2008
Yes, that works. Thank you very much bruce :-)



"bruce barker" wrote:

> try:
>
> e.Row.Cells[3].Attributes["onclick"] = "if (!confirm('do it?')) return
> false;" +
> Page.ClientScript.GetPostBackClientHyperlink(this.gvGrid, "MyCommand$"
> +
> "value123");
>
>
>
> -- bruce (sqlwork.com)
>
>
> "tiptechno" wrote:
>
> > hello,
> >
> > i was wondering how to attach a js confirm to the following command
> >
> > e.Row.Cells[3].Attributes["onclick"] =
> > Page.ClientScript.GetPostBackClientHyperlink(this.gvGrid, "MyCommand$" +
> > "value123");
> >
> > ... I have this in the RowDataBound of the GridView, it works fine, just
> > want to attach a js confirmation to it so it can be cancelled before posting
> > back.
> >
> > thanks...

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I show a confirm message before deleting a row in a gridview. Miguel Gómez Microsoft ASP .NET 3 13th May 2009 12:10 PM
Assign GridView columns dynamically cashdeskmac Microsoft ASP .NET 1 25th Feb 2009 10:16 PM
JavaScript confirm after click on button in GridView googleThis@nadolna.net Microsoft ASP .NET 0 22nd May 2006 05:30 PM
GridView edit validation, edit dropdown list, delete popup confirm =?Utf-8?B?a2Vu?= Microsoft ASP .NET 1 23rd Jan 2006 12:51 PM
Javascript confirm for editable gridview asp.net 2.0 rob merritt Microsoft Dot NET Framework 1 4th Apr 2005 10:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:45 PM.