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

Multiple Javascript errors when using radajax and radgrid

3 Answers 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Venkatesh
Top achievements
Rank 1
Venkatesh asked on 18 Dec 2012, 06:32 AM
HI,
I am using RADAjax and RADGrid in my visual web part (sharepoint 2010). I am getting few javascript errors on various conditions.

1) In the radgrid, when i add records, i am getting the below error:

Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '  Thank you for usin'.
Line: 4723
Char: 21
Code: 0
URI: http://servername/ScriptResource.axd?d=eL94jLYXyC1Ne7nMOhg5PV9Bc_C9wqj9jKtIId87UYURvmLRPgEsYaOYUpYwJp7GaVHtrRGRkeOKW3WYMMbRy-duh7cUEOREbfyYjiqjOGZ4qN1ieIbd3n1xpdnZQJGzfx3K6HUX6wvflpD-CcngpY9TgIxJDabpEaG8OReERINlgRhX0&t=ffffffffb868b5f4

2) I have a button outside the ajax, and clicking on the button, i am redirecting the page. I am getting the below javascript error:


Message: Sys.ArgumentNullException: Value cannot be null.
Parameter name: panelsCreated[3]
Line: 129
Char: 12
Code: 0
URI: http://servername/ScriptResource.axd?d=RPebyLkP-fhDCOP8R5TjxWPY-4fkPjRpQKETtPt1vJ0oYKjzG0P1oXDrWwqGUYowJk6FNzcl9JDcrVPqxhlevrLUyg2lficlL2Y9_KKnDvF49irZMVbCoI5gJzWm8v_Unf6FfAqjKOclBxnSZZAf9ybMAzMisFKw_edGwuOokTcB0Hr10&t=ffffffffb868b5f4

I have used the UI as below:
<asp:MultiView ID="CustomMultiView" runat="server">
    <asp:View ID="MyView1" runat="server">
  
 <div>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="radgrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="radgrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
 <telerik:AjaxUpdatedControl ControlID="hdnRowsCount" LoadingPanelID="RadAjaxLoadingPanel1" />
   </UpdatedControls>
          </telerik:AjaxSetting>
     </AjaxSettings>
</telerik:RadAjaxManager>
  
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" >
</telerik:RadAjaxLoadingPanel>
  
 <asp:HiddenField ID="hdnRowsCount" runat="server" Value="0" />
  
 <telerik:RadGrid ID="radgrid1" runat="server" ShowStatusBar="True" ShowFooter="True"
   OnItemCommand="radgrid1_ItemCommand" OnDeleteCommand="radgrid1_DeleteCommand"
   OnInsertCommand="radgrid1_InsertCommand" OnUpdateCommand="radgrid1_UpdateCommand"
   OnNeedDataSource="radgrid1_NeedDataSource" OnItemDataBound="radgrid1_ItemDataBound">
     
   <MasterTableView DataKeyNames="ProductNumber" AutoGenerateColumns="false" EditMode="InPlace"
    CommandItemDisplay="TopAndBottom" CommandItemSettings-AddNewRecordText="Add New Purchase Order">
         <Columns>
    <telerik:GridEditCommandColumn ButtonType="ImageButton">
     </telerik:GridEditCommandColumn>
      <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
       ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" ConfirmDialogHeight="100px"
         ConfirmDialogWidth="220px">
      </telerik:GridButtonColumn>
      
    <telerik:GridTemplateColumn DataField="ProductNumber" HeaderText="Product Number"
                            UniqueName="ProductNumber" Visible="true">
      <InsertItemTemplate>
       <telerik:RadTextBox ID="RadtxtPrdNumber" runat="server" Text="">
        </telerik:RadTextBox>
       </InsertItemTemplate>
  
         <EditItemTemplate>
<telerik:RadTextBox ID="RadtxtPrdNumber" runat="server" Text='<%# Eval("ProductNumber") %>'>
</telerik:RadTextBox>
 </EditItemTemplate>
  
<ItemTemplate>
<telerik:RadTextBox ID="RadtxtPrdNumber" ReadOnly="true" runat="server" Text='<%# Eval("ProductNumber") %>' />
</ItemTemplate>
 </telerik:GridTemplateColumn>
  
    </Columns>
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true">
                </ClientSettings>
            </telerik:RadGrid>
        </div>
  
 </asp:View>
    <asp:View ID="ThanksView" runat="server">
        <table width="100%" >
            <tr>
                <td colspan="2" align="center" >
                    <asp:Label ID="lblThankYou" Text="Thank You" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td />
                <td align="center">
                    <asp:Button ID="btnThanks" runat="server" Text="Ok" OnClick="btnThanks_Click" Width="90px" />
                </td>
            </tr>
            
        </table>
    </asp:View>
</asp:MultiView>

In the btnThanks click, i have the code below:

if (!string.IsNullOrEmpty(strThankURL))
CustomMultiView.ActiveViewIndex = 0;
 Response.Redirect(strThankURL);

How to fix the javascript errors?

Thanks

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 20 Dec 2012, 01:39 PM
Hi Venkatesh,

The first error you described is actually appears in case the trial version of the Telerik RadControls is used. The trial message contains ResponseWrite() method and it could cause the error you are facing. Please try using the dev version of the controls and the error should not appear.
As for the second error please try using RadAjaxmanager1.Redirect method instead of Response.Redirect and verify how it goes.

All the best,
Maria Ilieva
the Telerik team
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 their blog feed now.
0
Venkatesh
Top achievements
Rank 1
answered on 21 Dec 2012, 05:33 AM
Hi,
For the second issue,
I have a submit button outside the grid, in which i am changing the view after the items are saved.

I am sorry for the earlier post mistake, the javascript error is not in btnThanks click, however on the submit button click.

When i click submit, i save the items and change the view to show the Thanks message. At this time, i am getting the javascript error.

Below is the code used:

customMultiview.ActiveViewIndex = 1;
0
Maria Ilieva
Telerik team
answered on 21 Dec 2012, 02:10 PM
Hi Venkatesh,

As I mentioned in the other forum thread you have opened, there are some specifics in adding Ajax settings in SP environment.
Please follow the suggested steps and verify if this makes any difference.


Greetings,
Maria Ilieva
the Telerik team
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 their blog feed now.
Tags
Grid
Asked by
Venkatesh
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Venkatesh
Top achievements
Rank 1
Share this question
or