C
Chris Kettenbach
How do I get the page to respond to events on a dynamically loaded user
control in a placholder control?
I am trying to reference the control in the placeholder from my codebehind
for the page
On the calling page I have:
Protected WithEvents PH As System.Web.UI.WebControls.PlaceHolder
Protected WithEvents phMain As System.Web.UI.WebControls.PlaceHolder
Protected WithEvents btnCompanies As Button =
CType(Page.Controls("PH").Controls("btnCompanies"), Button)
Public Sub myCompBtn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCompanies.Click
phMain.Controls.Add(LoadControl("myctls\companies.ascx"))
End Sub
_________________
I get a "Input string was not in a correct format" error on the line where I
try to dimension the button. Any ideas how to correct the problem? Thanks
to everyone
control in a placholder control?
I am trying to reference the control in the placeholder from my codebehind
for the page
On the calling page I have:
Protected WithEvents PH As System.Web.UI.WebControls.PlaceHolder
Protected WithEvents phMain As System.Web.UI.WebControls.PlaceHolder
Protected WithEvents btnCompanies As Button =
CType(Page.Controls("PH").Controls("btnCompanies"), Button)
Public Sub myCompBtn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCompanies.Click
phMain.Controls.Add(LoadControl("myctls\companies.ascx"))
End Sub
_________________
I get a "Input string was not in a correct format" error on the line where I
try to dimension the button. Any ideas how to correct the problem? Thanks
to everyone