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

RadGrid script error

1 Answer 20 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 16 Aug 2010, 03:04 PM
Hello

I am using RadGrid in my application to insert and updated a record. I am using Master page in my application.

depending upon the querystring i an setting the mode of RadGrid. for example if i get a querystring i am setting the RadGrid in edit mode if not then in insert mode.

If it is in Insert mode and once the record is inserted, I will show a RAD alert message to user and then it will change it into edit mode for the inserted record.

If i try to change any data again and save the record back it gives an error "Object undefined”. I debugged this bug and found the cause for this problem.

It looks like after the post back the ID's of controls are getting changed and the javascript in WebResource.axd still referring with old IDS.WebResource.axd and JavaScript are not getting updated with the new IDs

For example, before Insert JavaScript trying to get the object using J-Query with the object ID as

 “ctl00_ContentPlaceHolder1_RadGridAccManageMain_ctl00_ctl02_ctl01_txtBoxCompanyName”

 

But after the Insert the client ID got changed to

 

“ctl00_ContentPlaceHolder1_RadGridAccManageMain_ctl00_ctl05_txtBoxCompanyName”

 

But the generated JavaScript in “WebResource.axd” still referring the object with old ID and it is causing JavaScript undefined error.

How do I resolve this issue?

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 19 Aug 2010, 12:27 PM
Hi Edward,

If you are using any <script> tags with inline code expressions (of the form <%= %>) to output the client IDs of your controls, try wrapping the <script> tags in a RadScriptBlock. If not, post some code we can look at.

Veli
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
Tags
Grid
Asked by
Edward
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or