Last post Oct 29, 2014 03:32 PM by Carthalion
Oct 22, 2014 02:16 PM|Carthalion|LINK
This is hard to explain. Right now in my ASP.Net VB program I use Session State to send values from one screen to another. An example would be for a mortgage scenario, sending loan parameters to another aspx page to calculate ARM details. This works OK
except for redirecting back to the original screen. Being stateless, everything is gone. Or, using the back button does not work well at all. Here is my idea:
As part of sending parameters to the second screen, create a single data record. Right now, I use a MySQL database with the records bound to a drop down list. What I would like to do is create the single record. Then when the screen opens again, use Form
Load to trigger retrieving the record.
I already have the code to save and load the record. What I do not know how to do is skip having to call the record using the drop down list.
Does this make sense? Any ideas?
Oct 22, 2014 05:06 PM|smirnov|LINK
What dropdown is used for? If it's used to select an initial parameter on the first screen then you could save selected value into session and check if session has value then pre-select dropdown.
protected void Page_Load(object sender, EventArgs e)
if (!IsPostBack && Session["Key"] != null)
DropDownList1.SelectedValue = Convert.ToString(Session["Key"]);
Oct 22, 2014 10:56 PM|Lannie|LINK
Trips to the database can be costly when scaling up to large number of users.
Depending on complexity of ARM section, it might be information you can simply hide and show on the same page as the mortgage parameters
saving loading another page and saving one or more trips to database.
Oct 29, 2014 03:32 PM|Carthalion|LINK
I think that you are right.