Solved

Asp.net AJAX According Panel with GridView

Posted on 2009-05-12
4
1,423 Views
Last Modified: 2012-08-14
Hello to all its been a while and I am stuck on this one.
Ok here it is.
First and foremost I have a gridview which works perfectly. When I mean perfectly I mean you can update/delete/select/index change / etc. This gridview is part of a usercontrol which I call on my page.

Now the problem is when I put this gridview in an Ajax Accordian Panel which makes the
users can click on the panel to slide up or down. When the Users decides to click on the next page index, or Edit controls I get this error
"Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request. "

Again this only happens when I put the gridview within the Accordian Panel..if I don't have it in there then I get no error at all.

Is there a solution to this madness LOL.
Thanks in Advance guys for helping this noob :).


This is my Front End Code for the accordian panel..which my gridview is pullout of a user control
<cc1:Accordion ID="AccordMain" runat="server">
    <Panes>
                <cc1:AccordionPane ID ="AccordColor" runat ="server">
             <Header><div class ="TitleRoll"  style="display:block; border:2px navy outset;   color:White;"> Add / Edit Color </div> </Header>
               <Content>
                  <ucIntCol:ucIntColors ID ="UcColor" runat ="server" />
               </Content>
            </cc1:AccordionPane>
             
    </Panes>
   
    </cc1:Accordion>

Open in new window

0
Comment
Question by:saruman101
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Expert Comment

by:MrAgile
ID: 24372739
Hi There,

What version of .net are you using? What server os is the application running on?

Sean
0
 

Author Comment

by:saruman101
ID: 24375614
I'm building this web application with visual studio 2008 .net framework 3.5
My current OS is windows 7 RC which is on my desktop.
And as for my web server right now I'm just currently using the built in version of Visual Studio so I'm not using IIS yet.
0
 
LVL 2

Expert Comment

by:krishrr
ID: 24376155
If u need to add a different control on each postback to the same placeholder don't do that and instead make a different placeholder for each different control and each control should be added to a certain placeholder (don't add different kinds of control to the same placeholder at the same location)

OR

You can set enableviewstate=false on the control if u don't need the viewstate
0
 

Accepted Solution

by:
saruman101 earned 0 total points
ID: 24376415
Hey guys I figure it out...and I guess it was by luck.

Ok first of all I do have different controls on different placeholders and the only one that was giving me the problem was the gridview itself.Well it turns out to be that in my user control within the grid view I had a small DIV tag which for what reason I don't remember why I had that there but it was there.

So when I would put the user control into the accordian pane it would then include the div as well within inside the accordian. When I would click on anything within the grid whether it was to update/paging/etc I would get the error. As soon as I remove the DIV tag everything works as it suppose to be.

Thanks guys for your help and advice :)
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question