Loading value to control on insert pagehttp://forums.asp.net/t/1750509.aspx/1?Loading+value+to+control+on+insert+pageSat, 17 Dec 2011 18:21:26 -050017505094735830http://forums.asp.net/p/1750509/4735830.aspx/1?Loading+value+to+control+on+insert+pageLoading value to control on insert page <p>Hello,</p> <p>I am new to dyndata &amp; asp.net.&nbsp; I've created a dd website using Linq to SQL and have set to customizing it.&nbsp; Having much success largely due to posts already on this forum (tip of the hat to Steve Naughton).&nbsp; However now I am stuck!</p> <p>I have an insert page for a transaction table that has&nbsp; a foreign key (vendor name/number).&nbsp; The drop-down loads correctly and I've added a &quot;Define New&quot; option in the list.&nbsp; When that value is selected I immediately send the user to my customized insert page for the vendor table.&nbsp; After that record is added I return them to the original transaction-table insert page and preselect the newly added vendor from the drop-down for them.</p> <p>That's wonderful, but any other values they entered on the transaction insert page before selecting &quot;Define New&quot;, of course, are gone.&nbsp; I figured I could retrieve those values and save to the session and then re-load them when selecting the new vendor for them.&nbsp; And have successfully done everything except that last step -- loading the values back to the screen.&nbsp; And actually I am doing that too - to the controls, but the values get blanked out somewhere in the automated code, I guess.&nbsp; I'm loading them in the ForeignKey_Edit template on page load.&nbsp; I've thought that perhaps I should be changing the data source but I don't know how.</p> <p>Is what I'm attempting possible?&nbsp; I could be going about this the wrong way but I seem to be one step away from success and I'm certainly open to trying a comletely different way of accomplishing this.</p> <p>Note: in the code below, the value originally entered on the page before leaving it is loaded into the text box both the first time and again when it's re-retrieved.&nbsp; That suggests to me that I really have changed the control and it must be getting overlaid later.</p> <pre class="prettyprint">Dim tbc = Page.FindControlRecursive(&quot;__RMANumber&quot;) Dim tb As TextBox = tbc.FindControl(&quot;TextBox1&quot;) tb.Text = RetrieveSessionValue(&quot;RMANumber&quot;) 'TEST: WAS THE CONTROL REALLY UPDATED? IF SO, THE SAVED VALUE SHOULD BE IN TB AFTER THIS. tbc = Page.FindControlRecursive(&quot;__RMANumber&quot;) tb = tbc.FindControl(&quot;TextBox1&quot;)</pre> <p>&nbsp;</p> 2011-12-16T21:46:48-05:004736649http://forums.asp.net/p/1750509/4736649.aspx/1?Re+Loading+value+to+control+on+insert+pageRe: Loading value to control on insert page <p>Hi have a look at article <a href="http://csharpbits.notaclue.net/2009/12/popup-insert-control-for-dynamic-data.html"> A Popup Insert control for Dynamic Data </a>that may have what you want.</p> 2011-12-17T18:21:26-05:00