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

RadAjaxPanel fails silently adding entity to viewstate

3 Answers 40 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 17 Jul 2013, 09:49 AM
I explain my issue, in a webform I can add entries to viewstate without problems through my userControl, sample:

Public Property ItemId As Integer?
    Get
        Return Me.ViewState("Id")
    End Get
    Set(value As Integer?)
        Me.ViewState.Add("Id", value) 
    End Set
End Property

But, if this entry is a dbcontext not attached entity, RadAjaxPanel seems to be affected. Sample code adding entity:

Public Property ItemId As Integer?
    Get
        Return Me.ViewState("Id")
    End Get
    Set(value As Integer?)
        Me.ViewState.Add("Id", value)
        Dim ctx = MyEntityContext
        ctx.Configuration.ProxyCreationEnabled = False
        Dim item = ctx.SomeCollection.find( value )
        Me.ViewState.Add("item", item)
    End Set
End Property

After adding 'item' to viewstate RadAjaxPanel don't respond, for example making visible or changing values to RadTextBox or other controls.

I have make a lot of tests, I can store into ViewState all kind of objects, for example, I have tested with new String() { "a", "b" } and all runs perfectly but storing detached entity.

Somebody know what this happens? Also, somebody has a workaround to store dbcontext simple entity through posts?

Regards

 

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 22 Jul 2013, 07:18 AM
Hi Daniel,

In order to easily isolate the issue could you please share of the same scenario works correctly in case the RadAjaxPanel is removed from the page? Also could you please test the same with regular asp UpdatePanel instead of RadAjaxPanel and let us now if the result is the same?

Regards,
Maria Ilieva
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Daniel
Top achievements
Rank 1
answered on 23 Jul 2013, 03:19 PM
Hello Maria,

thanks about your suggestion. Tested and UpdatePanel also fails silently.

Any new suggestion to isolate this issue are welcome.

regards,
daniel.
0
Accepted
Maria Ilieva
Telerik team
answered on 26 Jul 2013, 08:10 AM
Hello Daniel,

It appears that the issue is a general framework behaviour which is not directly related to our controls. however in your case I would suggest you ti use Session to keep the EntityFramework objects when Ajax request is used instead of the ViewState.

Regards,
Maria Ilieva
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
General Discussions
Asked by
Daniel
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or