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

Issue with Page Refresh (F5) after creating an Event

6 Answers 483 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Annie
Top achievements
Rank 1
Annie asked on 29 Jul 2008, 04:59 PM
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

6 Answers, 1 is accepted

Sort by
0
salman
Top achievements
Rank 1
answered on 29 Jul 2008, 06:19 PM
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
0
Annie
Top achievements
Rank 1
answered on 29 Jul 2008, 08:45 PM
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...

0
T. Tsonev
Telerik team
answered on 30 Jul 2008, 08:32 AM
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.
0
Annie
Top achievements
Rank 1
answered on 04 Aug 2008, 08:10 PM
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>

0
Accepted
T. Tsonev
Telerik team
answered on 05 Aug 2008, 08:32 AM
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.
0
Ema
Top achievements
Rank 1
answered on 23 Oct 2013, 02:06 PM

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?

Tags
Scheduler
Asked by
Annie
Top achievements
Rank 1
Answers by
salman
Top achievements
Rank 1
Annie
Top achievements
Rank 1
T. Tsonev
Telerik team
Ema
Top achievements
Rank 1
Share this question
or