Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > change button type from "submit" to "button"

Reply
Thread Tools

change button type from "submit" to "button"

 
 
Tony WONG
Guest
Posts: n/a
 
      04-22-2010
the button is created at runtime

the button is used as "select all checkbox" in gridview by javascript

Dim lc As New Button
lc.Text = "Select All"
lc.Attributes.Add("onclick", "SelectAll('" & GridViewID & "');")
container.Controls.Add(lc)

when the button is clicked, it run javascript "but then submit".

how can i change the button type from "submit" to "button"

so that it can only run the javascript.

Thanks.

tony


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      04-22-2010
On Apr 22, 6:22*am, "Tony WONG" <(E-Mail Removed)> wrote:
> the button is created at runtime
>
> the button is used as "select all checkbox" in gridview by javascript
>
> * * Dim lc As New Button
> * * lc.Text = "Select All"
> * * lc.Attributes.Add("onclick", "SelectAll('" & GridViewID & "');")
> * * container.Controls.Add(lc)
>
> when the button is clicked, it run javascript "but then submit".
>
> how can i change the button type from "submit" to "button"
>
> so that it can only run the javascript.
>
> Thanks.
>
> tony


lc.Attributes.Add("onclick", "SelectAll('" & GridViewID & "');return
false;")
 
Reply With Quote
 
 
 
 
Tony WONG
Guest
Posts: n/a
 
      04-22-2010
Thanks a lot.


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Creating a Button that is type="button" and does not call __doPostBack Nathan Sokalski ASP .Net Web Controls 1 01-11-2010 03:57 PM
Creating a Button that is type="button" and does not call __doPostBack Nathan Sokalski ASP .Net 1 01-11-2010 03:57 PM
asp button always rendered as type="button" vs. type="submit" Sam ASP .Net Web Controls 1 11-25-2008 06:14 PM
A Paradise DNS address change? What change? There was no change. Tony Neville NZ Computing 7 09-22-2006 01:02 PM
Change image button type problem in IE Phil_Cam@bigpond.net.au Javascript 1 08-07-2006 05:43 AM



Advertisments