Dynamic Placeholder that Saves Child Controls View State

One asp.net custom control that I am loving right now is Denis Baur’s Dynamic PlaceHolder. I’m having to do an web application that must allow for an infinite number of standard web controls and maintain state as these are entered. I went down the AJAX.NET Professional route for a minute but ran into some issues. Instead of recreating the controls on Page_INIT on every request to add a control, I’m able to add to the the new controls to the placeholder list.
Example:

Function AddProduct(Byval strPN as String)

Dim Count As Int32 = CType(ViewState(strPN & “Count_v”), Int32)
Count += 1 ‘increase viewstate count

Dim ddlProduct as New DropDownList
with ddlproduct
.id = “ddl” & strPN “Product” & Count.ToString()
dphP.Controls.Add(ddlproduct) ‘add to dynamic placeholder
end with

ViewState(pn & “Count_v”) = Count ‘add back to viewstate count

End Function

Tim

A .NET, PHP, Marketing Guru authority, at least I hope I am. Reach me at tboland@gmail.com

4 thoughts on “Dynamic Placeholder that Saves Child Controls View State

  1. order soma says:

    buy soma online no prescription…

    soma 350mg 180. soma hernandez. soma dependence. soma bras. soma muscle relaxant. aura soma. …

  2. Danielgrant says:

    By doing this, an eye set structured can definitely end up being 3 fashionable style watches in only one. Canadian Online Casino

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>