473,378 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

UpdatePanel/Accordion/GridView

I'm wondering why I can't find the updatepanel control in my codebehind file Page_Load event. I have several gridviews, each in their own accordion control/pane, all inside an updatepanel (which I was planning to split into one for each accordion when I finally get one UpdatePanel working). I guess it is probably something of which I am ignorant.

Expand|Select|Wrap|Line Numbers
  1. upFull = (UpdatePanel) this.Page.FindControl("upFull");
  2. // the previous line returns null so please be gentle with the beatdown :)
  3. gvMyWG = (GridView)upFull.ContentTemplateContainer.FindControl("gvMyWG");
  4.  
  5. gvMyGG = (GridView)upFull.ContentTemplateContainer.FindControl("gvMyGG");
  6. //Next thing I do is call a static method and pass all grids by reference to set all gridview datasources to a SqlDataReader that is getting multiple result sets (MARS).
  7.  
Feb 24 '09 #1
3 7363
Frinavale
9,735 Expert Mod 8TB
Are your update panels in the MasterPage?

Or are your update panels in a regular ASP page or Web User Control?
If so, you shouldn't have to use the FindControl to locate your GridViews.
Feb 24 '09 #2
Frinavale,

Thanks for your response. I am sorry I wasted your time. Evidently I did write this properly the first time around, but I kept getting a compiler error when passing GridViews via reference. "Object not set to an instance" so I figured I was doing something wrong (because they were within the UpdatePanel). That's when I started with the "please god let this work because I am falling behind" code :). This isn't the first time that I have written the code properly but the IDE chokes when and gives me build errors. It seems like it is caching it somewhere and refuses to update it when I do a clean solution/rebuild.

Once again thanks for your help.
Feb 24 '09 #3
Evidently, I stepped on my "jump to conclusions mat" and celebrated too soon. After I deleted my class variables which were part of the "please god" code, I am now getting the original error message again. "The name gvMyGridView does not exist in this context".
Here is the control hierarchy:

MasterPage
ContentPage
ContentPlaceHolder
UpdatePanel
Accordion
GridView

In the page_load event I am just trying to pass each gridview by reference to a static method so they can be bound to a Sqldatareader. I guess I will try ripping out the UpdatePanel for now.
Feb 24 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: mike | last post by:
I have a page with a LoginView which contains a Gridview and a DetailsView, each in its own UpdatePanel The problem that I am experiencing is that when I select a record in the Gridview (using a...
1
by: podpi | last post by:
Hello I'm having a bit of a proooblem. I have a gridview which has a checkbox as one of the templatecolumn's. When it is checked, it hides a textbox containing a DateTime templatefield...
0
by: Reinhard | last post by:
Hi, Need some directions on Ajax, UpdatePanel and Gridview to achive the following: I like to show a Gridview with Data ONLY if the user is interested in Details, but without a full page...
3
by: srilakshmim | last post by:
Hello I want to create Accordion (Ajax Control Tool Kit)dynamically. My Code is as follows Code: ( cpp ) protected void Page_Load(object sender, EventArgs e) { try ...
0
by: rsdev | last post by:
Hi, I am new to implementing Asynchronous javascript in asp.net (or any framework) and have come across a problem. In a user control I have an accordion with a nested updatepanel, the trigger...
1
by: SachinSachin | last post by:
Hi All, I am implementing a custom gridview control, that emits some javascript to blink a row whenever a new row is added in gridview. The gridview is inside the <asp:updatepanel> for...
2
by: DeekoVB5 | last post by:
I can't get an UpdatePanel on my page to work. One control - an ImageButton in a GridView - works the first time you click on it, but then freezes all of the controls on the form. The paging...
0
by: Jeff | last post by:
hey asp.net 3.5 I have 2 UpdatePanels in my webpage. This webpage has a GridView, which one of its column is a templatefield which again contain a UpdatePanel and a button... The other...
13
by: SAL | last post by:
Hello, I'm trying to include a popup in the ItemTemplate of a gridview row. The ItemTemplate for the field contains a textbox and when the user clicks in the textbox I want a popup panel to show...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.