Click here to Skip to main content
15,885,065 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Please tell me someone how i can send multiple value on gridview link button click, on click on this link than open new page using QueryString. now we would like to change QueryString and i don't want to use Session, is there any other way to resolve this issue.asp.net with c#. blow code of gridview linkbutton.

What I have tried:

<a href='ActWiseCLG.aspx?DistrictIdCLG=<%# Eval("DistCode")%>&District=<%# Eval("District")%>&dCLG=true'><%# Eval("NoOfCLG")%></a>
Posted
Updated 18-Apr-19 3:05am

 
Share this answer
 
Comments
UDTWS 18-Apr-19 1:33am    
Thanks for reply but i would like to send values on another page. is it possible that we send values from one page to another page using View State.
[no name] 18-Apr-19 16:40pm    
I don't see why one can't "unpack" the view state on the server, add it to a "new" page, and send it off. Nothing to do with "sessions". Maybe because I don't see it as a "problem"; just a redirect.

https://stackoverflow.com/questions/9225231/how-to-pass-viewstate-value-from-one-aspx-page-to-another-page

https://www.codeproject.com/Articles/37753/Access-ViewState-Across-Pages

etc.
etc.
Christian Graus 18-Apr-19 1:52am    
No. It's not possible. You're basically asking, how do I do something without using any of the processes that exist to do that. Unless you use session, you can't store it on the server so the server knows which user it's for, and unless you use the query string, you can't do it on the client. Your only other option would be to abandon technology that's been obsolete for a decade and use Angular or React. Then you'd have state on the client.
UDTWS 22-Apr-19 0:39am    
i am trying to pass value using postbackurl property of linkbutton. and hidden field value pass in another page. when i use this in new file working properly but where i really want to use not working their. for this any solution. even i try to pass static value from one page to another page in real page.
Why don't you want to use the Session? It's the best solution for your problem, which I assume is to "hide" the code from the user and stop them changing it. The only other alternatives to the Session still allow the user to see or change the code. Data in the Session stays on the server and the user never sees it. The next best solution would be cookies, but you would probably have to encrypt the data in the cookie. It's a lot of hassle when using the session is simple.
 
Share this answer
 
When you pass information from one page to another you are doing what's called "maintaining state". In order for your application to maintain that state you have to save the data somewhere, either in Session or in a backing database somewhere.

Web sites are natively stateless and connectionless. It's a query/response system. The client (browser) says "hey, give me this page" and your server (web app) responds with that page or an error page if it doesn't exist. There is no further connection between the two machines.

So either your client-side code has to pass back any values the server needs to create the next page or your server has to maintain that information in a backing store, like Session or a database.

...and here you are trying to do it without using any of the framework that is there to help you do that very thing!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900