Note that there are some explanatory texts on larger screens.

plurals
  1. POTrying to retrieve values in an UpdatePanel from the code behind
    primarykey
    data
    text
    <p>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.</p> <p>When the form is posted back the table isn't available to our code...</p> <p>Here is the code for that section, this is a DynamicData edit page.</p> <pre><code> &lt;asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel2"&gt; &lt;ProgressTemplate&gt; &lt;div&gt;Getting subjects...&lt;/div&gt; &lt;/ProgressTemplate&gt; &lt;/asp:UpdateProgress&gt; &lt;asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" &gt; &lt;ContentTemplate&gt; &lt;asp:Timer ID="Timer1" runat="server" Interval="2000" Enabled="false" &gt; &lt;/asp:Timer&gt; &lt;div id="subjects_fav"&gt; &lt;asp:Table ID="tabSubjectsFav" runat="server" BorderWidth="2" BorderColor="Aquamarine"&gt; &lt;/asp:Table&gt; &lt;/div&gt; &lt;asp:Button ID="UpdateButton" runat="server" OnClick="SaveEverything" Text="Save Everything" /&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; 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 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload