Skip to content

Instantly share code, notes, and snippets.

@abergs
Created September 2, 2010 09:07
Show Gist options
  • Save abergs/562078 to your computer and use it in GitHub Desktop.
Save abergs/562078 to your computer and use it in GitHub Desktop.
Public Function createBtn(ByVal Handler As EventHandler, Optional ByVal text As String = "Ändra", Optional ByVal link As String = "main.aspx")
Dim editbtn As New LinkButton
editbtn.Attributes.Add("rel", link)
editbtn.Attributes.Add("class", "Btn")
editbtn.Attributes.CssStyle.Add("margin-left", "10px")
editbtn.ID = "editBtn"
Dim icon As New Image
icon.ImageUrl = "Images/edit.png"
icon.CssClass = "icon"
editbtn.Controls.Add(icon)
Dim Btntext As New HtmlGenericControl("span")
Btntext.InnerText = text
Btntext.ID = "text"
editbtn.Controls.Add(Btntext)
AddHandler editbtn.Click, Handler
Return editbtn
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment