You could use a Timer within an UpdatePanel so that in every tick of Timer1 you can save the data from the input to Session.
For example in the following markup:
<div class="row">
<label>First Name:</label>
<asp:TextBox ID="FirstNameTextBox" runat="server"></asp:TextBox>
</div>
<div class="row">
<label>Last Name:<label>
<asp:TextBox ID="LastNameTextBox" runat="server"></asp:TextBox>
</div>
<div class="row">
<label>City:</label>
<asp:DropDownList ID="CityDropDownList" runat="server"></asp:DropDownList>
</div>
<div class="row">
<label>State:</label>
<asp:DropDownList ID="StateDropDownList" runat="server"></asp:DropDownList>
</div>
<div class="row">
<asp:Button ID="SubmitButton" runat="server" Text="Button" />
</div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" Enabled="true" Interval="5000" OnTick="Timer1_Tick"></asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
The code behind for this would be:
protected void Page_Load(object sender, EventArgs e)
{
if (Session["FirstName"] != null) FirstNameTextBox.Text = Session["FirstName"].ToString();
if (Session["LastName"] != null) LastNameTextBox.Text = Session["LastName"].ToString();
if (Session["City"] != null) CityDropDownList.SelectedValue = Session["City"].ToString();
if (Session["State"] != null) StateDropDownList.SelectedValue = Session["State"].ToString();
}
protected void Timer1_Tick(object sender, EventArgs e)
{
Session["FirstName"] = FirstNameTextBox.Text;
Session["LastName"] = LastNameTextBox.Text;
Session["City"] = CityDropDownList.SelectedValue;
Session["State"] = StateDropDownList.SelectedValue;
}
Every time the Timer1 ticks, you can save the data from the form fields to your Session and on Page_Load(...) if there are any data in Session you could auto fill them.
Make sure to clear the data from the Session when the user actually submits the form.