views:

227

answers:

1

i wrote following code to create a linkbutton programmatically, but its showing like lable at runtime not as link

Dim lnkbutton As LinkButton = New LinkButton()
lnkbutton.ID = "HostelsClub" & dr("dshotelid").ToString()
lnkbutton.Text = "HostelsClub"
lnkbutton.PostBackUrl = Request.Url.ToString()

lnkbutton.ToolTip = "Click here To Book"
AddHandler lnkbutton.Click, AddressOf lnkBook_Click
PHbook.Controls.Add(lnkbutton)
+1  A: 

problem is not with your link button you need to add event handler for link button in page's init function .. than only it will work..

developer 2010
wow..really. i remember i have read it once..i am sure it will work
Rajesh Rolen- DotNet Developer