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

Argument Null Exception when using AddAjaxSetting

0 Answers 84 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 02 Aug 2012, 10:53 AM
Hello,

I am working on an ASP.Net page (using VB) that dynamically builds a table and form.  When the page loads and it's building the form and table there are a series of controls that I'm trying to create and add to an Ajax Manager (that is also created in code) but when I'm trying to do an AjaxManager.AjaxSettings.AddAjaxSetting(oCheckbox, oRadTextBox) I get an error:

ArgumentNullException was unhandled by user code.
Value cannot be null.
Parameter name: page

I was doing some research into the problem and found this post:
http://www.telerik.com/community/forums/aspnet-ajax/ajax/problem-when-using-radajaxmanager-in-umbraco.aspx 

At the end of the post Maria Ilieva was following up with the original poster and said something about MasterPages and how the ajax manager is placed.  I'm using master pages so I suspect that's my problem.  The master page is very simple and has nothing more than formatting, style statements, logos, etc.  The web form that uses the master page is where the ajax manager resides.  I've paraphrased a stripped down simple version of the code here so you can see what I'm doing.  I'm creating two controls, adding them to cells to a row and table then trying to add them to the ajax manager.

oCheckbox.ID = "chk1"
oCheckbox.AutoPostBack = True
oCell.Controls.Add(oCheckbox)
oRow.Cells.Add(oCell)
oRadTextBox.ID = "txtSerial"
oCell.Controls.Add(oRadTextBox)
oRow.Cells.Add(oCell)
oTable.Rows.Add(oRow)
 
oAjaxManager.AjaxSettings.AddAjaxSetting(oCheckbox, oRadTextBox)

The ArumentNullException error occurs on the last statement with the AddAjaxSetting method.  How am I supposed to be calling this from the web form when using master pages?

No answers yet. Maybe you can help?

Tags
Ajax
Asked by
Tim
Top achievements
Rank 1
Share this question
or