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

Error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.

9 Answers 2074 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dharmesh Barochia
Top achievements
Rank 1
Dharmesh Barochia asked on 04 Nov 2009, 10:43 AM

I am getting javascript Error “Error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.”

 

When I use RadAjaxManager inside RadGrid’s EditFormSettings

 

<telerik:RadGrid

      <MasterTableView

            <EditFormSettings

                  <FormTemplate>

                        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

                                    <AjaxSettings>

                                        <telerik:AjaxSetting AjaxControlID="RadComboBox1" EventName="RadComboBox1_SelectedIndexChanged">

                                            <UpdatedControls>

                                                <telerik:AjaxUpdatedControl ControlID="RadComboBox2" />

                                            </UpdatedControls>

                                        </telerik:AjaxSetting>

                                    </AjaxSettings>

                                </telerik:RadAjaxManager>

 

9 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 05 Nov 2009, 12:38 PM
Hello Dharmesh ,

You are getting this error, because RadAjaxManager should  not be used inside RadGrid’s EditFormSettings. In order to achieve the desired functionality, please set RadGrid as updated control.

For more information about RadAjaxManager, please refer to the following help article:
http://www.telerik.com/help/aspnet-ajax/ajxajaxmanager.html

Best wishes,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Dharmesh Barochia
Top achievements
Rank 1
answered on 09 Nov 2009, 11:55 AM

Hi,

When I try to add RadAjaxManager inside Grid’s Form Template it gives me error.

“Sys.WebForms.PageRequestManagerServerErrorException:Object reference not set to an instance of an object.”

 

I think that we might not be able to add RadAjaxManager inside Grid, Is there any other way where I can get my solution.

 

0
Pavlina
Telerik team
answered on 09 Nov 2009, 03:09 PM
Hi Dharmesh,

Please note that you should not add RadAjaxManager inside RadGrid FormTemplate.
I suggest you review the following online example which handles the desired functionality. Please give it a try and see if it works as expected:
http://demos.telerik.com/aspnet-ajax-beta/grid/examples/dataediting/popupeditform/defaultcs.aspx

Regards,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Dharmesh Barochia
Top achievements
Rank 1
answered on 10 Nov 2009, 11:07 AM

Yes that’s true, we should avoid RadAjaxManager inside RadGrid, but I want that when I am adding or editing record some combobox value should be change and also there will be some operation on server site on changing control’s value.

 

In given link example RadAjaxManager set with checkbox and RadGrid that is outside of the Grid.

My requirement is that I want ajaxify controls which are inside <EditFormSettings template.

Will you please suggest me what I should do in this case?

0
Pavlina
Telerik team
answered on 10 Nov 2009, 01:28 PM
Hello Dharmesh,

To achieve your goal you need to reference the controls from the Edit form and add AjaxSettings for them in the RadAjaxManager.AjaxSettings collection. You can achieve this in the ItemCreated event hander.

For further information I will suggest you examine the following articles:
http://www.telerik.com/help/aspnet-ajax/ajxaddajaxsettingsprogrammatically.html
http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/dynamicajaxsettings/defaultcs.aspx

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Ashwin Deshpande
Top achievements
Rank 1
answered on 15 Apr 2010, 03:25 PM

 

Even i faced the same problem..used the below code but it didnt Worked.Listbox seems to refresh on username text Changed

ItemCreated Event

Dim
item As GridEditableItem = TryCast(e.Item, GridEditableItem)

 

 

 

 

 

Dim raditem1 As New RadComboBoxItem

 

 

Dim raditem2 As New RadComboBoxItem

 

 

Dim raditem3 As New RadComboBoxItem

 

 

Dim raditem4 As New RadComboBoxItem

 

 

If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then

 

 

Dim txtuserName As TextBox = DirectCast(item.FindControl("txtuserName"), TextBox)

 

 

Dim txtpassword As TextBox = DirectCast(item.FindControl("txtpassword"), TextBox)

 

 

Dim lstbLocations As ListBox = DirectCast(item.FindControl("lstbLocations"), ListBox)

 

 

 

RadAjaxManager1.AjaxSettings.AddAjaxSetting(txtuserName, lstbLocations)
END IF

0
Pavlina
Telerik team
answered on 16 Apr 2010, 01:30 PM
Hi Ashwin,

Could you please prepare and send us a simple running project, with which we can reproduce the problem locally? Thus we can research what is causing it and provide a solution.

All the best,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
David
Top achievements
Rank 1
answered on 04 May 2010, 02:28 PM
Hello Dharmesh,

I was also facing the same problem. Error was a run-time error in the code-behind file. To find the exact error, please debug your functionality step by step. I hope you will be able to figure-out the error.

Thanks,
Sarjeet
0
Pratibha
Top achievements
Rank 1
answered on 09 Dec 2011, 11:02 AM
Hi Pavita,

Also i am getting the same erro for calender control code.I am using as it is site code for special days caleder.

_headerImage =

DirectCast(RadCalendar1.FindControl("HeaderImage"), Image)

 

_footerImage =

DirectCast(RadCalendar1.FindControl("FooterImage"), Image)

 

AddImages(RadCalendar1.CalendarView)

Problem is in given below  line in -AddImages function

 

_headerImage.ImageUrl =

"Imagepath"

 

 

 



 

Tags
Grid
Asked by
Dharmesh Barochia
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Dharmesh Barochia
Top achievements
Rank 1
Ashwin Deshpande
Top achievements
Rank 1
David
Top achievements
Rank 1
Pratibha
Top achievements
Rank 1
Share this question
or