Thank you for your help.
I first tried to use the 2nd solution, cross page post backs, which
looked easier to me (since I didnt have any information about
Sessions), but it didnt work. The part after the FindControl expression
was not recognized by the VS2005. and since I didnt know what to import
(Imports System. what?) I made a search and after reading, which
lasted about 2 minutes, an article about sessions now it works fine.
this is what I used, in case anyone wonders:
Protected Sub LinkButton2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles LinkButton2.Click
Session.("selectedDate") = Calendar1.SelectedDate
Response.Redirect(URL as String)
End Sub
Muhammad Mosa wrote:
> You can use sessions this is a solution that work on both ASP.NET 1.x and
> ASP.NET 2.0
> the other solution is useing Cross Page Post Back. this will transfer you
> page viewstate to the postback page target.
> You use this by doing the following:
> 1)Set the PostBackUrl property of your button to the target Page
> 2) in your target Page use PreviousPage to get your control value like this:
> DateTime dtm = (Calendar)PreviousPage.FindControl("Calendar1").Se lectedDate;
>
> make sure that you check for PreviousPage is not NULL before use it.
>
> Hope this would help
> Regards
> --
> Muhammad Mosa
> Software Engineer & Solution Developer
> MCT/MCSD.NET
> MCTS: .Net 2.0 Web Applications
> MCTS: .Net 2.0 Windows Applications
>
>
> "Dot Net Daddy" wrote:
>
> > Hello,
> >
> > I want to pass the Calendar.SelectedDate to another page. But I dont
> > want to do it with either in the QueryString or HiddenField. Is there
> > another approach you can come up?
> >
> > Thanks in advance.
> >
> >
|