Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keeping added controls on postback
Message
From
21/05/2006 12:40:11
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01123789
Message ID:
01123824
Views:
16
>You need to add the controls eaerlier in the Page cycle. If you load them on Page_Load as I suspect you are POST back assignment (as well as Viewstate) have already occurred. You'll want to try and do this in OnInit() if possible...

Thanks for the help

I modified my code as this:
<script runat="server">
    Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        LXFramework.oPage = Me
        Dim loDataEntry As DataEntryDBUsersAdmin = New DataEntryDBUsersAdmin(LXFramework)
        loDataEntry.GenerateForm()
    End Sub

    Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'LXFramework.oPage = Me
        'Dim loDataEntry As DataEntryDBUsersAdmin = New DataEntryDBUsersAdmin(LXFramework)
        'loDataEntry.GenerateForm()
        LXFramework.BeforeEndRequest()
    End Sub
</script>
I obtain the same result. When I first access the first, everything is ok. The loDataEntry.GenerateForm() adds the additional controls on the page has needed. But, on postback, which is handled by loDataEntry.GenerateForm(), all the additional controls on the page that were added at runtime when the page was initially loaded are lost.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform