473,411 Members | 2,530 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,411 software developers and data experts.

Problem with ModalPopupExtender(AJAX) + C#

24
Hi all.
I am having trouble getting a ModalPopupExtender to display with the corresponding data. This will be triggered by clicking on a "Details" button in a gridview. Eg. by clicking on Row1 details button, ModalPopup will display Row1 information

I suspect this might be due to the following section:
Expand|Select|Wrap|Line Numbers
  1. protected void grdBookings_RowDataBound(object sender, GridViewRowEventArgs e)
  2. {
  3.  if (e.Row.RowType == DataControlRowType.DataRow)
  4.             {
  5.                 Button Details1 = (Button)e.Row.FindControl("details1");
  6.                 Details1.Attributes.Add("onclick", "return ShowMyModalPopup('" + grdBookings.DataKeys[e.Row.RowIndex].Values + "')");
  7.             }
  8. }
  9.  
ModalPopupExtender Code:
Expand|Select|Wrap|Line Numbers
  1. <asp:ModalPopupExtender ID="ModalPopupExtender1" BehaviorID="ModalPopupExtender1Behaviour" runat="server" 
  2. PopupControlID="Panel1" TargetControlID="details1" BackgroundCssClass="modalBackground" 
  3. OnCancelScript="HideModalPopup()" CancelControlID="Close"></asp:ModalPopupExtender>
  4.  
There is a warning stating Possible NullReferenceException at line grdBookings.DataKeys[e.Row.RowIndex]. I have not stated the DataSource in the gridview itself as Im not sure how to do so since Im using a custom Stored Procedure. Could this be a cause?

I hope those in the know could help me as much as possible, thank you.
Dec 31 '09 #1
0 1918

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

Similar topics

2
by: brett | last post by:
I have an AJAX updatepanel in an aspx page. Inside the updatepanel is a placeholder control, which loads various ascx files. This all works fine. One of the ascx files also has an updatepanel in...
4
by: NOTICIAS | last post by:
Hi everybody. A very basic web page using an ScriptManager and a RoundedCornersExtender fails loading at a shared hosting environment. In my local server, such page loads correctly. I'm...
0
by: =?Utf-8?B?SGFyZHkgV2FuZw==?= | last post by:
Hi all, I have a web form, and I want to use ModalPopupExtender from Ajax Toolkit. I am using IE 7.0 as browser, VS 2005 and Ajax and Ajax Tool Kit installed. Windows XP Pro. Now I have a...
1
by: Victor | last post by:
Hi guys i have a strange problem about my modalpopupextender. In my page, i put a gridview inside a updatepanel with paging enabled. also i put a modalpopupextender in another updatepanel to do...
1
by: querry | last post by:
Hi all, I am using the ASP.NET AJAX Toolkit form http://asp.net/ajax It has something called ModalPopupExtender to create a popup. You can view the live demo at...
4
balajibirlasoft
by: balajibirlasoft | last post by:
Am using a default converter object in ajax to convert the tables collection to a JSON string. First Input for toJSON Method is strTempData(String Builder) Second Input is the object for which...
2
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I am using a list search extender and have the control it is assigned to as a control in a template column in a gridview. Anyhow for some reason the type to search section that normally appears...
3
by: Bobby Edward | last post by:
I had a simple admin form for "Categories"... Details View: To INSERT new Category Grid View: To View, Edit and Delete all Categories I decided to put the INSERT Details View inside of a...
6
by: prasaddas | last post by:
How to PopUp a ModalPopUpExtender when we click a Row in UltraWebGrid?
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...
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...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.