Thanks for your suggestions.
You should never say never I guess, even though I had to scrap the previous project the same scenario is present in my current one.
I have to admit I find most of the documentation and demos regarding this confusing.
I've ended up using a solution I personally find simpler. At least I got it to work properly.
|Protected Sub RadAjaxManager1_AjaxRequest(ByVal s As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) |
| If Session("LoggedIn") = True Then |
| pnlLogin.Visible = False |
| pnlUserOptions.Visible = True |
| End If |
| Dim url As String = Page.Request.RawUrl.ToLower() |
| If url.EndsWith("mypage.aspx") Then |
| Dim RadGrid1 As RadGrid = Me.cphMain.FindControl("RadGrid1") 'cphMain is a contentplaceholder |
| RadGrid1.DataSource = Nothing |
| RadGrid1.Rebind() |
| End If |
|End Sub |
You could say the downside of this approach is that I'm checking the session state every time the user updates the grid, but it's not hard to modify the code to skip that if you would want to.
So my only remaining question would be: Is this approach undesirable for some reason I'm overlooking?