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
Solved

Asp.net AJAX According Panel with GridView

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

837 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