473,503 Members | 3,045 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing Data

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.

Aug 14 '06 #1
2 1266
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.

Aug 14 '06 #2
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.
Aug 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3940
by: Alex Vinokur | last post by:
Various forms of argument passing ================================= C/C++ Performance Tests ======================= Using C/C++ Program Perfometer...
58
10044
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
3
4736
by: Simon Harvey | last post by:
Hi, In my application I get lots of different sorts of information from databases. As such, a lot of information is stored in DataSets and DataTable objects. Up until now, I have been passing...
9
2287
by: Just Me | last post by:
PARAFORMAT2 is a structure that SendMessage will return stuff in. Is the "ref" correct or since only a pointer is being passed should it be by value? Suppose I was passing data rather then...
3
2670
by: Marc Castrechini | last post by:
First off this is a great reference for passing data between the Data Access and Business Layers:...
22
25546
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
12
2662
by: Andrew Bullock | last post by:
Hi, I have two classes, A and B, B takes an A as an argument in its constructor: A a1 = new A(); B b = new B(a1);
7
3290
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the...
3
2384
by: DaTurk | last post by:
If I call this method, and pass it a byte by ref, and initialize another byte array, set the original equal to it, and then null the reference, why is the original byte array not null as well? I...
3
1721
by: iu2 | last post by:
Hi all, I need your professional opinion about this. It is more a general programming dilemma rather then a C++ one, but since the project I write is in C++... We handle big structs of data....
0
7067
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
4992
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
371
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.