Vil. I think the preference on these boards to date is to use a QueryString in the URL, versus Session State which can become problematic when scaling your site. In your Response.redirect statement opening up Form1 you need to pick up your date and send it on over to Form2. Here's a tidbit of code for you if it might help.
'first capture your date in a textbox (or a declared variable, etc)
Sub calSelectChange(Sender as Object, e as EventArgs)
txtSampleDate.Text = calDateToUse.SelectedDate
End Sub
Next, include it in your Response.redirect to your Form2, e.g.,
Sub mybutton_Click(Sender as Object, e as EventArgs)
Response.redirect("\mypage.aspx?mydate='" & txtSampleDate.Text & "'"
End Sub
..something along those lines. Other State management techniques are available but there seems to be a preference here to use the Querystring.
Once on Form2 you just call the date:
Dim myDate As Date = Request.Querystring("mydate"
Hi Isadore - dates are definitely one of those areas where you will need a server.urlencode to get it into the querystring without causing a problem - they are likely to contain / or \ characters; check out Thread855-378759
Mark
In fact I am opening a Form2 having a Calendar and once a date has been selected and Form2 is closed, I have to store the date back in a Textbox (txtDate) of Form1.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.