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

RadNotification loading again when pressing f5

1 Answer 79 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Prasanth100
Top achievements
Rank 1
Prasanth100 asked on 30 Dec 2013, 01:59 PM
Hi Gurus,

 I am using RadNotification,when clicking submit button the notification window is displaying with success message.
here the issue is when pressing f5,RadNotification window is displaying again.
I am using RadNotification1.VisibleOnPageLoad = false on page_load event. but still the notification window is opening.

How to resolve this.

Thanks in Advance,
  Prasanth

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 31 Dec 2013, 04:13 AM
Hi Prasanth,

Please have a look into the following code snippet to achieve your scenario.

C#:
private bool _refreshState;
private bool _isRefresh;
protected override void LoadViewState(object savedState)
{
    object[] AllStates = (object[])savedState;
    base.LoadViewState(AllStates[0]);
    _refreshState = bool.Parse(AllStates[1].ToString());
    _isRefresh = _refreshState == bool.Parse(Session["__ISREFRESH"].ToString());
}
protected override object SaveViewState()
{
    Session["__ISREFRESH"] = _refreshState;
    object[] AllStates = new object[2];
    AllStates[0] = base.SaveViewState();
    AllStates[1] = !(_refreshState);
    return AllStates;
}
protected void RadButton1_Click(object sender, EventArgs e)
{
    if (!_isRefresh)
    {
        RadNotification1.VisibleOnPageLoad = true;
    }
}

Hope this will helps you.
Thanks,
Shinu.
Tags
Ajax
Asked by
Prasanth100
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or