I am developing a web application in asp.net. I am using a class with property fields to store data. And I want access that property field in another asp page without using Session
. Is there any way to pass the class object from one aspx.cs
page to another (like query string). When I tried to pass it through query string and when I tried to access it one another page, I got the compile time error 'cannot convert type to 'class' type'
.
You can do it two ways:
I recommend to use the second option. However, you should reconsider the question, might be, there is better approach to your root issue.
are you using MVC? try using TempData see the article here
http://www.codeproject.com/Articles/476967/WhatplusisplusViewData-2cplusViewBagplusandplusTem
or using the generic asp.net forms see this article about viewstate
http://www.codeproject.com/Articles/37753/Access-ViewState-Across-Pages
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.