R
R.A.M.
Hello,
I have written an .aspx page which calls Calendar.aspx page to select
birth date which should be assign to some text box control on first
page.
Here's the code of first page:
Birthdate: <asp:TextBox ID="Birthdate" runat="server"
ValidationGroup="Birthdate" />
<asp:Button ID="Calendar" runat="server"
Text="Calendar"
OnClientClick="window.open('Calendar.aspx');" />
....
public partial class WWWPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Birthdate from calendar:
if (Session["Birthdate"] != null)
Birthdate.Text = (string) Session["Birthdate"];
}
....
Here's Calendar.aspx.cs:
....
public partial class CalendarPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Session["Birthdate"] = null;
}
protected void Calendar_SelectionChanged(object sender,
EventArgs e)
{
Session["Birthdate"] =
Calendar.SelectedDate.ToString().Substring(0, 10);
}
}
After Calendar page is used and closed I cannot see retrieved date
because I got a message (I translated it to English, my language is
Polish):
"Page cannot be refreshed without sending information again. Press
button 'Try again' or press button 'Cancel', to return to page which
you wanted to view."
After pressing 'Try again' I see what I wanted but don't need this
message box. Could you explain me what's going on and tell me how to
correct it?
Thank you very much.
/RAM/
I have written an .aspx page which calls Calendar.aspx page to select
birth date which should be assign to some text box control on first
page.
Here's the code of first page:
Birthdate: <asp:TextBox ID="Birthdate" runat="server"
ValidationGroup="Birthdate" />
<asp:Button ID="Calendar" runat="server"
Text="Calendar"
OnClientClick="window.open('Calendar.aspx');" />
....
public partial class WWWPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Birthdate from calendar:
if (Session["Birthdate"] != null)
Birthdate.Text = (string) Session["Birthdate"];
}
....
Here's Calendar.aspx.cs:
....
public partial class CalendarPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Session["Birthdate"] = null;
}
protected void Calendar_SelectionChanged(object sender,
EventArgs e)
{
Session["Birthdate"] =
Calendar.SelectedDate.ToString().Substring(0, 10);
}
}
After Calendar page is used and closed I cannot see retrieved date
because I got a message (I translated it to English, my language is
Polish):
"Page cannot be refreshed without sending information again. Press
button 'Try again' or press button 'Cancel', to return to page which
you wanted to view."
After pressing 'Try again' I see what I wanted but don't need this
message box. Could you explain me what's going on and tell me how to
correct it?
Thank you very much.
/RAM/