Issue with Page Refresh (F5) after creating an Event

7 posts, 1 answers
  1. Annie
    Annie avatar
    10 posts
    Member since:
    Jan 2007

    Posted 29 Jul 2008 Link to this post

    Hi,

    We are having a problem with the RadScheduler.  After creating an Event (it doesn't matter if its just a single or a recurring event...), when you press F5 to refresh the page, another event is created... basically a duplicate of what you just created. 

    I wonder if this is a bug or am just missing something (i.e., needs to declare something, etc...).  Below are the step-by-step detail in recreating the issue:

    1.  From the Calendar, double click on a date to create an event.  (NOTE:  As I have indicated above, it doesn't matter if its a Single or Recurring event because the results are the same.)  Once the event is created, it will show up on the Calendar. 
    2.  Click on the browser's "Page Refresh" button or "F5"... you will notice that a duplicate event is created.

    What should we do to prevent this issue from happening?

    Thanks for your help.

    - Annie
  2. salman
    salman avatar
    15 posts
    Member since:
    May 2008

    Posted 29 Jul 2008 Link to this post

    It seems to like something to do with the PostBack.

    Are you using something like this in your Page_Load event:

    if (!IsPostBack)
    {
    try loading appointments here
    }


    Thanks,
    -Salman
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Annie
    Annie avatar
    10 posts
    Member since:
    Jan 2007

    Posted 29 Jul 2008 Link to this post

    Hi,

    Yes, we do.  The problem is, not only does it display a duplicate of the newly created event... it does physically create a duplicate event in the database.  I verified it by checking the database.  So if you refresh the page (either click on the Page Refresh button or press F5) several times, it will also create a duplicate event equivalent to how many times you press the Refresh button.

    Appreciate your help.  Thanks so much...

  5. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 30 Jul 2008 Link to this post

    Hi Annie,

    I guess that this is expected behavior. You are resubmitting the form data and the last operation will be repeated on each refresh. The browser should warn you about that.

    The solution is to use AJAX, either wrap the scheduler in an UpdatePanel or use RadAjaxManager, as in the online demos. This should resolve the issue, as the commands will be transferred via asynchronous connections and they will not be resubmitted on refresh.

    All the best,
    Tsvetomir Tsonev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Annie
    Annie avatar
    10 posts
    Member since:
    Jan 2007

    Posted 04 Aug 2008 Link to this post

    Hello,

    We are using RadAjaxManagerProxy.  Having said that, can I still use the UpdatePanel parallel to the RadAjaxManagerProxy? 


    Below is our code:

    <

    telerik:radajaxmanagerproxy id="ScriptManProxy" runat="server"></telerik:radajaxmanagerproxy>

    <td valign="top"> 
        <telerik:radscheduler  id="schCalendar" runat="server" datakeyfield="ID"     
            datasubjectfield
    ="Title" datastartfield="StartDTm"dataendfield="EndDTm"          
            datarecurrencefield
    ="RecurrencePattern"
            datarecurrenceparentkeyfield="RecurringParentID" 
            overflowbehavior
    ="Expand"monthvisibleappointmentsperday="3"  
            onnavigationcomplete
    ="Scheduler_NavigationComplete"
            onappointmentinsert
    ="Scheduler_AppointmentInsert"
            onappointmentcommand
    ="Scheduler_AppointmentCommand"
            onappointmentdelete
    ="Scheduler_AppointmentDelete"
            onappointmentupdate
    ="Scheduler_AppointmentUpdate"
            onappointmentcreated="Scheduler_AppointmentCreated" 
            onclientappointmentediting
    ="OnClientAppointmentEditing"       
            onformcreated
    ="Scheduler_FormCreated"
            onformcreating="Scheduler_FormCreating"starteditinginadvancedform="true"  
            startinsertinginadvancedform
    ="true" enableembeddedskins="false"   
            enableadvancedform
    ="true" enableresourceediting="true"
            enablecustomattributeediting="true"timelineview-userselectable="false"
            localization- advancedmoredetails="Invitees"
           
    localization-advanceddescription="Title">  
            <
    advancededittemplate><scheduler:advancededitform runat="server" 
                id
    ="AdvancedEditForm1"subject='<%# Bind("Subject") %>'
                start='<%# Bind("Start") %>'end='<%# Bind("End") %>'
               
    recurrenceruletext='<%# Bind("RecurrenceRule") %>'
                summary='<%# Bind("Summary") %>'
                
    isholiday='<%# Convert.ToBoolean(Eval("IsHoliday")) %>'
               
    isfeatured='<%# Convert.ToBoolean(Eval("IsFeatured")) %>'
                showonpersonal='<%# Convert.ToBoolean(Eval("ShowOnPersonal")) %>'
               
    contactphonenumber='<%# Bind("ContactPhoneNumber") %>'
                location='<%# Bind("Location") %>groupid='<%# Eval("GroupID") %>'
                resourceid='<%# Eval("ResourceID") %> name='<%# Eval("Name") %>'
                requireresponsebydtm='<%# GetRespondByDate(Eval
                     ("RequireResponseByDTm")) %>
    '
                maxrespondents='<%# GetMaxRespondents(Eval("MaxRespondents")) %>'           
                oncheckboxvalueupdate
    ="EditTemplate_CheckboxValuesUpdated"
                oninviteesupdate="EditTemplate_InviteesUpdated"
                ongroupvalueupdate="EditTemplate_GroupValueUpdated"
                onresourcevalueupdate="EditTemplate_ResourceValueUpdated"/> 
            </advancededittemplate>
           
    <advancedinserttemplate> <scheduler:advancedinsertform runat="server"
                ID="AdvancedInsertForm1"subject='<%# Bind("Subject") %>'
                start='<%# Bind("Start") %>'end='<%# Bind("End") %>'
                recurrenceruletext='<%# Bind("RecurrenceRule") %>'
                summary='<%# Bind("Summary") %>'
                isholiday='<%# Convert.ToBoolean(Eval("IsHoliday")) %>'
                isfeatured='<%# Convert.ToBoolean(Eval("IsFeatured")) %>'
                showonpersonal='<%# Convert.ToBoolean(Eval("ShowOnPersonal")) %>'
                contactphonenumber='<%# Bind("ContactPhoneNumber") %>'
               
    location='<%# Bind("Location") %>'groupid='<%# Eval("GroupID") %>'
                resourceid='<%# Eval("ResourceID") %>'name='<%# Eval("Name") %>'
                requireresponsebydtm='<%# Eval("RequireResponseByDTm") %>'
                maxrespondents='<%# Eval("MaxRespondents") %>' 
                oninviteesinsert
    ="InsertTemplate_InviteesInserted"
                oncheckboxvalueinsert="InsertTemplate_CheckboxValuesInserted"
                ongroupvalueinsert="InsertTemplate_GroupValueInserted"
                onresourcevalueinsert="InsertTemplate_ResourceValueInserted"/>  
            </
    advancedinserttemplate>
        
    </telerik:radscheduler> 

         <telerik:radtooltipmanager id="RadToolTipManager1" runat="server" 
                 onajaxupdate
    ="RadToolTipManager1_AjaxUpdate" autotooltipify="false"
                 relativeto
    ="Element"position="TopLeft"width="400px"height="300px"
                 sticky
    ="false"skin="Web20" showevent="OnMouseOver">
         </
    telerik:radtooltipmanager>
     
     </td>

  7. Answer
    T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 05 Aug 2008 Link to this post

    Hello Annie,

    It seems that you are missing the AjaxSettings for the RadScheduler. They should look like this:

    <telerik:radajaxmanagerproxy id="ScriptManProxy" runat="server"
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="schCalendar"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="schCalendar" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings>      
    </telerik:radajaxmanagerproxy> 
     


    Otherwise, yes, you can use UpdatePanels independently of RadAjaxManager.

    Greetings,
    Tsvetomir Tsonev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Ema
    Ema avatar
    1 posts
    Member since:
    Oct 2013

    Posted 23 Oct 2013 Link to this post

    hi,
    for example: if you click on 'button' system will catch the event 'button_click'. if you refresh the page, system will re execute again the same event. to don t have this problem, in your event insert : on your event

    private void button_click(object sender, System.EventArgs e)
    {
        button.Enabled =false;
        button.Enabled =true;
    }

    is what you meant?

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017