From: Tony WONG on
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


From: Alexey Smirnov on
On Apr 22, 6:22 am, "Tony WONG" <x...(a)netvigator.com> 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;")
From: Tony WONG on
Thanks a lot.