2.0: setting TextBox.Text from another page

R

R.A.M.

Hi,
I need to set BirtDate TextBox with a date taken from another browser
window with Calendar control. I tried this way:
On first page I have:

Birth date: <asp:TextBox ID="BirthDate" runat="server"
ValidationGroup="BirthDate" />

with behind-code:

protected void Page_Load(object sender, EventArgs e)
{
...
Session["BirthDate"] = BirthDate;
}

On second page I have Calendar control and behind-code:

protected void Kalendarz_SelectionChanged(object sender, EventArgs e)
{
((TextBox) Session["BirthDate"]).Text =
Calendar.SelectedDate.ToString().Substring(0, 10);
}

Although this assigments works there's no visible result on first
page. Could you explain me please why? How to write correct code?
Thank you very much.
/RAM/
 
C

clintonG

// Populate the Session variable
Session["BirthDate"] = Calendar.SelectedDate.ToString().Substring(0, 10);

// Cast the Session to a String object to access the value of the variable
String birthDate = (String)Session["BirthDate"];

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top