change button type from "submit" to "button"

T

Tony WONG

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
 
G

Guest

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;")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top