This is a migrated thread and some comments may be shown as answers.

[Solved] Global variables being wiped out on Ajax calls

0 Answers 87 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Chanh
Top achievements
Rank 1
Chanh asked on 09 Apr 2009, 02:59 PM

My RadEditor has an Ajax call to save file on webserver as following. The codes are recommended from the documentation:

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

 

   <script type="text/javascript">

 

 

 

       function ajaxRequest(operation)

 

 

        {

 

           var ajaxManager = <%= RadAjaxManager1.ClientID %>;

 

 

 

 

 

           ajaxManager.ajaxRequest(operation);

 

 

        }

 

   </script>

 

 

 

</telerik:RadScriptBlock>

In my code behind file, I have a  temp variable:
string temp;

 

 

 

protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)

 

    {

        if (e.Argument != "Save")

            {

 

               return;

 

 

             }

 

        //Saving content

 

 

 

 

       string content = RadEditor1.Content;

 

 

    }

 

protected void Page_Load(object sender, EventArgs e)

 

 

 {
        temp =
"123";
}

The problem I'm having is that whenever user hits the save button, the global variable (temp) is wiped out. This is very frustrating...! Could someone help me please? I don't know what to do... Thanks!

 

 

 

 

 

 

 

No answers yet. Maybe you can help?

Tags
Editor
Asked by
Chanh
Top achievements
Rank 1
Share this question
or