previous pages values

Posted by Venkatesh under ASP.NET on 2/2/2011 | Points: 10 | Views : 1307 | Status : [Member] | Replies : 12
Hi

I have 2 pages.In the first page having one datalist which contains 20 controls are there like textboxes,dropdownlist etc.,
and submit button is there.when user click on submit button it will navigate to second page.In the second page back button is there.When
user clicks on back button it will navigate to first page.

My Questions:When user clicks on back button in the second page.I want to show all the values user had entered in the first page.
How to do this?
I dont want use sessions and viewstate.

Thanks & Regards
Venkatesh.Ponna




Responses

Posted by: Karthikanbarasan on: 2/2/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Check this thread

http://www.dotnetfunda.com/forums/thread3399-pass-values-between-2-aspnet-pages.aspx

As sheo mentioned these are the options available

Thanks
Karthik
www.f5Debug.net

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathya4260 on: 2/2/2011 [Member] Starter | Points: 25

Up
0
Down
Hi venkatesh,

Use can use Sessions that would only suits you better has u holding more than twenty values...

Sathish Kumar S

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 2/3/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi venkatesh,

if u want to use control values to next page without session so u use QueryString .. i think it's working for You

Best Regard's
Prabhakar

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathya4260 on: 2/3/2011 [Member] Starter | Points: 25

Up
0
Down
Hi prabha,

I think using query string to pass the values of 20 controls would not be advisable, wats ur opinion...

Sathish Kumar S

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/3/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Using query string to pass the values (abt 20) its not a good practice... Since you dont want to use sessions and viewstate u can better opt for CACHE or COOKIE...

Again cookie is gng ot be a problem if the clients disabled them... so better to go with cache and use it

Thanks
Karthik
www.f5Debug.net

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathya4260 on: 2/3/2011 [Member] Starter | Points: 25

Up
0
Down
I think its better to use the entities, it safer and faster if anyother way is there kindly let me know...

Sathish Kumar S

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/3/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Ok... Im not sure about entities... can you brief a bit abt that?

Thanks
Karthik
www.f5Debug.net

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathya4260 on: 2/3/2011 [Member] Starter | Points: 25

Up
0
Down
Sure karthik,

Just write an separate class as entity.cs

Then use the get and set methods to store the values of that particular control which relevant data type and name,
and then use these data's through out the project...

Hope this helps

Sathish Kumar S

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/3/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Oh ok... like a module in vb.net.... got it now...thanks sathish

Thanks
Karthik
www.f5Debug.net

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathya4260 on: 2/3/2011 [Member] Starter | Points: 25

Up
0
Down
If need more info send an mail to sathya4260@gmail.com, Let we join to play with codes...

Sathish Kumar S

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/3/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Sure sathish...

Thanks
Karthik
www.f5Debug.net

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 2/3/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Another option which you might think of if you dont want to use session is to have one hidden field in both pages and when you leave the page1 save all your details into hidden field in xml format and access that using request object in the page load of page2 and save the same into another hidden field in page2 so that when you click back you can access that back in the same fashion.

But still what I suggest is to create an entity class and store all your values into that and save that entity object into session.

Thanks and Regards
Madhu

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response