change button type from "submit" to "button"

  • Thread starter Thread starter Tony WONG
  • Start date Start date
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
 
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

Back
Top