473,789 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UpdatePanel/Accordion/GridView

77 New Member
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 7391
Frinavale
9,735 Recognized Expert Moderator Expert
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
stoogots2
77 New Member
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
stoogots2
77 New Member
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
ContentPlaceHol der
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
11638
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 SelectButton), the selected record is shown in the DetailsView, which is correct - however, when I choose "Update" on the DetailsView I am presented with the EditItemTemplate which contains the first record in the DetailsDataSource. The code...
1
5217
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 (visible="false" which I set in the RowDataBound Event). I have put the DateTime TextBox inside an updatepanel with an asynchronous trigger on the checkbox. It is hiding and displaying perfectly with the updatepanel whenever the checkbox is selected....
0
3455
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 reload! If the page loads, only a summary (eg. COUNT of recs) should be displayed
3
3436
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 { Accordion aCC = new Accordion();
0
6889
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 is a link button in the header. I have read several posts that suggest I need to add the ControlID in the codebehind, so I have and I don't get any errors, but also there's nothing loading into the updatepanel. Here's the code; Codebehind:
1
3074
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 parital page rendering. The problem is when I put the gridview inside the updatepanel, I don't see the HTML table that is created as a result from rendering the gridviewcontrol and thus when new row is added, it does not blink, however when i just put the...
2
2523
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 controls of the GridView refresh the entire page, as if the UpdatePanel wasn't there. There is an outside control - a dropdownlist - which is set to trigger the updatepanel, and also refreshes the entire page. Below are some snippets from the code....
0
2962
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 UpdatePanel is located outside the GridView....
13
3520
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 allowing the user to make a selection from the popup window. I have enabled AJAX extensions and have a working sample outside of a gridview. However, when I click in the textbox of a gridview row, all I see is a really small square instead of the...
0
9663
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9016
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6765
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.