Click to See Complete Forum and Search --> : Simple One, PostBack Event


HushPuppy
January 21st, 2004, 02:20 AM
Hello,

I need to transfer a string to a aspx file and work on the string and display it, this i can mange.
but after a while i need to refresh the page, i have downloaded a control Link Here (http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=69a7c7bb-939a-4777-aceb-2d9ebbe35b85)
that call the postback option.
is the postback refresh the whole class.
if on the start of the page, i got the string and put it in the aspx.cs public string var., can't i use the var. from the class after the postback has been called?

how can i save the string and use it all the time.
thanks,
:confused:

Andy Tacker
January 21st, 2004, 04:39 AM
I approached the solution to such problems as you are facing through the usage of session parameters. in my project, i had a login page, if the login is successfull, i would simply do the following:
this.Session["User"] = m_szLoginName;
this.Session["UserID"] = m_iLoginID.ToString();

I think you can implement similar approach to your string. so, you will have access to your string value in your whole project by simply calling...
this.Session["MyString"] = "this is my string";
and
string m_szMyString = this.Session["MyString"];

Hope that will help

HushPuppy
January 21st, 2004, 05:14 AM
I have manged using ViewState.
off tpoic issue, do you have any idea how can i display a message to the client "please wait" untill the page is fully downloaed?

Andy Tacker
January 21st, 2004, 06:39 AM
no not really.
post the question.