web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 4.0 - Treeview in custom page is gone after postback !!!

(0) ShareShare
ReportReport
Posted on by 1,720

Dear All,

I have a custom aspx page with treeview(checkbox nodes) that binds values from CRM database. When i click a save button in the custom aspx page i am using all the values from the checked nodes of treeview to insert back to CRM database itself.

Everything works perfect when i run the custom application independently.

But when i put the custom page to CRM server without any errors and in proper way itself (i am calling this custom page in an iframe of a form). When i click the same save button, the tree view is gone and an eeror is shown in the iframe section as 'The index must be non-negative or grater than zero'

Its because the treeview is not there after postback.....But why ? it must be there.....!!!!! its a control i have dragged it to custom page while development.....thye binding is only in runtime.....

even i commented all the codes in save button and tried all the process again....the treeview is gone after clicking the save button (but only after putting the custom page in CRM

*This post is locked for comments

I have the same question (0)
  • Kenny Vaes Profile Picture
    345 on at

    Hi,

    You should put an EnableViewState="true" on the top of the aspx page. 

    CRM will disable this property when you put the page in the ISV folder. It's in the web.config of the CRM website.

    From CRM 4.0 web.config: 
    <pages buffer="true" enableSessionState="false" enableViewState="false" validateRequest="false" />

     So the top of your page should look like this:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" EnableViewState="true" %>

    Had this problem myself a while ago. This solved things for me. Hope it works for you too.

    Regards,

    Kenny

  • Binu Kumar S Profile Picture
    1,720 on at
    Brilliant !!!!!!!!!!! Kenny....brilliant That worked for me like a dream.... Thanks a lot dear friend..... Cheers
  • Kenny Vaes Profile Picture
    345 on at

    You're welcome ;-)

  • Cédric Profile Picture
    on at

     Very usefull post Kenny!!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans