开发者

How to use a dynamically created UpdatePanel on .NET

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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜