Solved

Asp.net AJAX According Panel with GridView

Posted on 2009-05-12
4
1,406 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
  • 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now