Author: Bunn1 | Posted on: 12/11/2009 4:44:23 PM | Views : 284

Ok, heres the problem, how can add a runat and server call to a dynamicaly created button like below:
assumptions for example: there is a placeholder on the page called myPH

Dim newbtn As Button = New Button
newbtn.ID = mybutton1
newbtn.CssClass = "newclass"
newbtn.UseSubmitBehavior = False - removing this so the button is a submit button does not work either

newbtn.OnClick = "mysub"     - this does not work, but this is the idea I'm going for
newbtn.Attributes("OnClick")= "mysub" - this creates a javascript onclick
myPH.Controls.Add(newbtn)
so is there a way to add runat and create an OnClick that actualy posts the page
thanks for your replies

...

Go to the complete details ...