So I have an ASP.Net website. I'm trying to make it where the owner of the website can change a portion of her website that is just text. I was thinking to make it a string variable that she can change on one part of the website and it posts on the other part. I tried looking at [this page](http://msdn.microsoft.com/en-us/library/vstudio/ms178139(v=vs.100).aspx"A link to Cross Page posting with ASP.Net Webpages") and the directive it tells me to include isn't recognized. I can get the variable to change and display on the page I changed it with, but have no idea how to make it to where I can use it on another page.
Asked
Active
Viewed 66 times
0
-
How long do you want her change to persist? – HABO Jul 02 '14 at 02:50
-
You could make it a session variable or put it in a query string. – shree.pat18 Jul 02 '14 at 02:54
-
@HABO Until she wants to change it again. And shree.pat18, I don't necessarily want to redirect to the page after she makes the change. Is that what you meant by using a query string? – Joseph Jul 02 '14 at 03:02
-
You'll need to store the data somewhere like a file or database if you want the change to survive an application restart in IIS. Once you've done that, the issue of cross page posting should vanish. – HABO Jul 02 '14 at 03:04
-
So not even using session variables, as the other commenter suggested, would work? – Joseph Jul 02 '14 at 03:05
-
Using a session variable would only allow your session to access the value. How you would get the value into another user's (session's) query string is even more mysterious. Sessions typically vanish after 20 minutes of inactivity, so that wouldn't help. An application variable would stick around until the site shuts down and IIS likes to shut down sites that aren't being actively used. In any event, a server restart will lose anything that wasn't written out to somewhere persistent. – HABO Jul 02 '14 at 03:08
-
So entering it in the database it is. I was trying to see if there was a way to make it persist outside of that route. Trying to make myself a better coder. Thanks for your help. – Joseph Jul 02 '14 at 03:10
-
You should roll this up into an answer and I can mark it as such. – Joseph Jul 02 '14 at 03:10
-
possible duplicate of [asp.net pass a value into next page](http://stackoverflow.com/questions/8241470/asp-net-pass-a-value-into-next-page) – Murtaza Jul 02 '14 at 03:17
1 Answers
0
In order to have changes maintained across sessions and application restarts the data will need to be written out to persistent storage. Typically that would be a database, or for simple systems, one or more files.
If you are going allow modification of the site then there are security concerns. A common scenario would be to have an administrative login that allows access to the underlying data.

HABO
- 15,314
- 5
- 39
- 57
-
Thanks @HABO, I do have a form of security for the website owner. You da man! – Joseph Jul 02 '14 at 03:18