I've got an asp.net web form, there is an update panel that contains a table with textboxes that the user enters values into. The table is in an updatepanel as the textboxes are generated from a very long running db query. It is generated a few seconds after the form loads using a timer control.
When the form is posted back the table isn't available to our code...
Here is the code for that section, this is a DynamicData edit page.
<asp:UpdateProgress ID="UpdateProgress1" runat="server"
AssociatedUpdatePanelID="UpdatePanel2">
<ProgressTemplate>
<div>Getting subjects...</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" Interval="2000" Enabled="false" >
</asp:Timer>
<div id="subjects_fav">
<asp:Table ID="tabSubjectsFav" runat="server" BorderWidth="2" BorderColor="Aquamarine">
</asp:Table>
</div>
<asp:Button ID="UpdateButton" runat="server" OnClick="SaveEverything" Text="Save Everything" />
</ContentTemplate>
</asp:UpdatePanel>
Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)
'DynamicDataManager1.RegisterControl(DetailsView1)
DynamicDataManager1.RegisterControl(lvArticles1)
DynamicDataManager1.RegisterControl(lvArticles2)
DynamicDataManager1.RegisterControl(lvArticles3)
DynamicDataManager1.RegisterControl(lvArticles4)
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
'trying to get the id_project for this page
'get article id for first article
If Not IsPostBack Then
Timer1.Enabled = True
Else
UpdatePanel2.Update()
End If
'now get related project from db
Dim db As New MTRData.mtddDataContext()
Dim art = (From a In db.articles _
Where a.id = Request.QueryString("id") Take 1 _
Select a).SingleOrDefault()
'txtid_project.Text = art.id_project
'need to use this all over the place so saving it as a property type thing as well
_ProjectID = art.id_project
_PublicationID = art.id_publication
_ArticleID = art.id
End Sub
Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If boolTimerFired = False Then
Timer1.Enabled = False
boolTimerFired = True
GenerateSubjectsFavGrid(_ArticleID)
UpdatePanel2.Update()
End If
Timer1.Enabled = False
End Sub