I am new to dyndata & asp.net. I've created a dd website using Linq to SQL and have set to customizing it. Having much success largely due to posts already on this forum (tip of the hat to Steve Naughton). However now I am stuck!
I have an insert page for a transaction table that has a foreign key (vendor name/number). The drop-down loads correctly and I've added a "Define New" option in the list. When that value is selected I immediately send the user to my customized insert
page for the vendor table. 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.
That's wonderful, but any other values they entered on the transaction insert page before selecting "Define New", of course, are gone. I figured I could retrieve those values and save to the session and then re-load them when selecting the new vendor for
them. And have successfully done everything except that last step -- loading the values back to the screen. And actually I am doing that too - to the controls, but the values get blanked out somewhere in the automated code, I guess. I'm loading them in
the ForeignKey_Edit template on page load. I've thought that perhaps I should be changing the data source but I don't know how.
Is what I'm attempting possible? 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.
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. That suggests to me that I really have changed the control and it must be getting overlaid
later.
Dim tbc = Page.FindControlRecursive("__RMANumber")
Dim tb As TextBox = tbc.FindControl("TextBox1")
tb.Text = RetrieveSessionValue("RMANumber")
'TEST: WAS THE CONTROL REALLY UPDATED? IF SO, THE SAVED VALUE SHOULD BE IN TB AFTER THIS.
tbc = Page.FindControlRecursive("__RMANumber")
tb = tbc.FindControl("TextBox1")
jchaddmc
Member
2 Points
2 Posts
Loading value to control on insert page
Dec 16, 2011 09:46 PM|LINK
Hello,
I am new to dyndata & asp.net. I've created a dd website using Linq to SQL and have set to customizing it. Having much success largely due to posts already on this forum (tip of the hat to Steve Naughton). However now I am stuck!
I have an insert page for a transaction table that has a foreign key (vendor name/number). The drop-down loads correctly and I've added a "Define New" option in the list. When that value is selected I immediately send the user to my customized insert page for the vendor table. 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.
That's wonderful, but any other values they entered on the transaction insert page before selecting "Define New", of course, are gone. I figured I could retrieve those values and save to the session and then re-load them when selecting the new vendor for them. And have successfully done everything except that last step -- loading the values back to the screen. And actually I am doing that too - to the controls, but the values get blanked out somewhere in the automated code, I guess. I'm loading them in the ForeignKey_Edit template on page load. I've thought that perhaps I should be changing the data source but I don't know how.
Is what I'm attempting possible? 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.
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. That suggests to me that I really have changed the control and it must be getting overlaid later.
Dim tbc = Page.FindControlRecursive("__RMANumber") Dim tb As TextBox = tbc.FindControl("TextBox1") tb.Text = RetrieveSessionValue("RMANumber") 'TEST: WAS THE CONTROL REALLY UPDATED? IF SO, THE SAVED VALUE SHOULD BE IN TB AFTER THIS. tbc = Page.FindControlRecursive("__RMANumber") tb = tbc.FindControl("TextBox1")sjnaughton
All-Star
27318 Points
5458 Posts
MVP
Re: Loading value to control on insert page
Dec 17, 2011 06:21 PM|LINK
Hi have a look at article A Popup Insert control for Dynamic Data that may have what you want.
Always seeking an elegant solution.