I have the following code:
Dim newUp As New UpdatePanel
newUp.ID = "upFlux"
Dim newLbl As New Label
newLbl.ID = "lblFlux"
newUp.ContentTemplateContainer.Controls.Add(newLbl)
ok, now in another part of my code (another method) i want to get this update panel and work on it. I want something like:
Dim up As new UpdatePanel("upFlux")
up.someCodeHere
what can i do?
ty in ad开发者_如何学运维vance
After you are done creating a new UpdatePanel
and adding the label, you should add it to the page
Page.Controls.Add(newUp)
and later on you should be able to reference the UpdatePanel
like this
Dim up as UpdatePanel = TryCast(Page.FindControl("upFlux"), UpdatePanel)
精彩评论