Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Passing Data

Reply
Thread Tools

Passing Data

 
 
Dot Net Daddy
Guest
Posts: n/a
 
      08-14-2006
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.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TXVoYW1tYWQgTW9zYQ==?=
Guest
Posts: n/a
 
      08-14-2006
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.
>
>

 
Reply With Quote
 
 
 
 
Dot Net Daddy
Guest
Posts: n/a
 
      08-14-2006
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.
> >
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing an array from FORTRAN to C then passing it within C andReturning it to FORTRAN deadpickle C Programming 1 11-07-2010 02:38 PM
Passing parameters to an executable vs. passing them to a server Ramon F Herrera C++ 8 09-13-2009 02:48 AM
passing copy of a pointer to a variable vs passing the copy pereges C Programming 7 06-01-2008 02:36 PM
Passing by const & and returning a temp vs passing by value and returningit Victor Bazarov C++ 25 03-23-2005 04:24 PM
Passing large data between forms, different apps terry ASP .Net 1 07-07-2003 06:05 PM



Advertisments