Define code in codebehind outside Page_Load which is not rerender after event?

  1. #1

    Define code in codebehind outside Page_Load which is not rerender after event?

    Hey guys, I have a question.

    I have built a form in code-behind, which is filled with data. If I change the values ​​and save the form, disappear, the new values ​​and the old values ​​appear, but saving has worked in the background.

    Why, I know. He leads well known after the event the Page_Load again and renders me the new form. But is there a way to define code that will not run again? I do not want that my form is rendered again. I think this creates the problem that the old values ​​are displayed. I always have to make an extra reload the page so that the new values ​​are displayed. Not acceptable :-/ I hope someone can help me?
  2. #2
    Hi @kilianaegerter,

    Welcome to the Ext.NET forums!

    But is there a way to define code that will not run again?
    Not sure, but you might need to wrap the code in
    if (!X.IsAjaxRequest) 
    {
        // your code
    }
  3. #3
    if (!X.IsAjaxRequest) 
    {
        // your code
    }
    This solution I have already found.

    But my problem is that I build the form in the code behind. So I save the form, it renders the Page_Load new and he does not find the form panel, because the code is not executed because "if (! X.IsAjaxRequest)".

    Can be defined Ext.Net elements only on the aspx page and not via code-behind, if they are not re-rendered?
  4. #4
    Probably, you can wrap in
    if (!X.IsAjaxRequest) 
    {
        // your code
    }
    only the code where you apply values to fields.
    Last edited by Daniil; May 07, 2014 at 12:27 PM.
  5. #5
    My solution was the method Page_PreRender.

    I define my structure in Page_Load and fill the data in Page_PreRender with your code from above.

    Thank you!

Similar Threads

  1. Replies: 2
    Last Post: Apr 05, 2014, 1:29 AM
  2. Replies: 11
    Last Post: Jan 30, 2014, 11:49 AM
  3. [CLOSED] TreePanel not load outside event Page_load
    By vnmacedo in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Apr 30, 2013, 6:06 AM
  4. Replies: 3
    Last Post: May 19, 2010, 11:43 PM

Tags for this Thread

Posting Permissions