473,626 Members | 3,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ajax ModalPopup panel just shows at bottom of the page

1 New Member
i have been trying (and sometimes succeeding) to use the modalpopupexten der to show various panels of controls on my asp pages. the strange problem that i keep on running into is that sometimes it works, displaying an awesome popup, while other times, it doesn't show a popup at all, but rather just page posts back and the panel becomes visible at the bottom of the page (where it is situated in the designer). what is even stranger to me is that in some instances, the popup works but a few days later i'll come back to find that it has stopped working.

i've been scouring forums, but have found no one who has had this same problem. one post mentioned control validators and on one of the pages where it stopped working after having previously worked, the only thing that i could see as having changed was that control validators were added. i commented out the validators though, and the problem persisted. i also use validators on all my pages, and on some pages, the popup works despite the validators.

in most cases, the panels, how they are called and their content are exactly the same from one page to the next. this is another strange factor: i've literally copied and pasted code from one page to another and it works on the first page, but not on the next. but then it will work on another one i paste the code onto.
this is a brief synopsis of how i've used the popups:
  • • pages (which use a master page) have multiple panels and popup extenders
  • • controls are inside an update panel, which on a panel, which is then on another panel (this was a suggestion i found when earlier trying to use update panels with the popup)
  • • targetid of the mpe is set to a "dummy" button with style="display: none;"
  • • .show() method of the extender is then called from the server side click event of a linkbutton (needed to do it like this because the linkbutton is inside a formview, and therefore cannot be directly used as a string name for the targetid...or can it?? at any rate, i didn't know how so i did it by adding an event handler to the linkbutton when the formview changes mode)

the popup shows modal when i show the "dummy" button and then click on that, but then when i close the popup, it displays at the bottom again, and that won't close when i click on the close button.

does anyone have any clues?? please help!!


Below are some code snippets that i thought were relevant. I don't mind posting everything, but it might be a bit of a monster post.
This is one of the pages that had worked before, but now doesn't seem to work anymore...

ASPX PAGE:
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Forms/Site.Master"
  2.     Codebehind="EventDetailEditForm.aspx.vb" Inherits="UberDB.Web.EventDetailEditForm"
  3.     Title="Untitled Page" %> 
  4.  <%@ Register Assembly="Validators" Namespace="Sample.Web.UI.Compatibility" TagPrefix="cc1" %>
  5. <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  6. ...various other controls, some of which have control validators on them - i've changed these now to the "ajax friendly" validators, but it still doesn't work :(
  7.  
  8. <asp:GridView ID="CalendarEventRemindersGridView" runat="server" AutoGenerateColumns="False"
  9.                                 CellPadding="4" ForeColor="#8E9275" GridLines="None" Width="100%" UseAccessibleHeader="true">
  10.                                 <FooterStyle BackColor="#DDEB93" Font-Bold="True" ForeColor="#669900" />
  11.                                 <Columns>
  12.                                   ...various other collumns, but the one that is important for the panel is this "edit" one: it displays an image button that gets clicked on to show the popup 
  13.                                     <asp:TemplateField>
  14.                                         <ItemTemplate>
  15.                                             <asp:ImageButton ID="EditReminderImageButton" runat="server" ImageUrl="~/Images/Edit.png"
  16.                                                 Height="20" Width="20" CommandName="Edit" CommandArgument='<%#GetReminderId(GetDataItem())%>'
  17.                                                 Visible='<%#GetReminderEditVisible(GetDataItem())%>' />
  18.                                         </ItemTemplate>
  19.                                     </asp:TemplateField>
  20.                                 </Columns>
  21.                                 <RowStyle BackColor="#DDEB93" />
  22.                                 <EditRowStyle BackColor="#2461BF" />
  23.                                 <SelectedRowStyle BackColor="#669900" Font-Bold="True" ForeColor="#333333" />
  24.                                 <PagerStyle BackColor="#DDEB93" ForeColor="669900" HorizontalAlign="Center" />
  25.                                 <HeaderStyle CssClass="GridStaticHeader" BackColor="#DDEB93" Font-Bold="True" ForeColor="#669900"
  26.                                     HorizontalAlign="Left" />
  27.                                 <AlternatingRowStyle BackColor="#EBF3BE" />
  28.                                 <EmptyDataTemplate>
  29.                                     There are no reminders for this event.
  30.                                 </EmptyDataTemplate>
  31.                             </asp:GridView> 
  32.  
  33. <asp:Button ID="ModalPopupDummyButton" Text="dummy button" runat="server" />
  34.     <asp:Panel ID="Panel1" runat="server" Height="200px" Width="792px">
  35.         <asp:Panel ID="EditReminderPanel" runat="server" Height="112px" Width="728px" BackColor="#DDEB93"
  36.             BorderColor="#DDEB93" BorderStyle="Solid" BorderWidth="10px" Font-Bold="False">
  37.             <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  38.                 <ContentTemplate>
  39.  
  40.                    ...various controls... (NO validators on any of these controls)
  41.  
  42.                 </ContentTemplate>
  43.             </asp:UpdatePanel>
  44.             <br />
  45.             <asp:Button ID="EditReminderButton" runat="server" Text="Save" />
  46.             <asp:Button ID="CancelEditButton" runat="server" Text="Cancel" />
  47.         </asp:Panel>
  48.         &nbsp;
  49.     </asp:Panel>
  50.     <ajaxToolkit:ModalPopupExtender ID="EditReminderModalPopupExtender" TargetControlID="ModalPopupDummyButton"
  51.         runat="server" PopupControlID="EditReminderPanel" BackgroundCssClass="modalPopupBackground"
  52.         DropShadow="true">
  53.     </ajaxToolkit:ModalPopupExtender> 
  54.  

Then in the CODE BEHIND:
Expand|Select|Wrap|Line Numbers
  1.  Private Sub CalendarEventRemindersGridView_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles CalendarEventRemindersGridView.RowCommand
  2.         If e.CommandName = "Edit" Then
  3.             Dim calendarEventReminder As New BusinessObjects.CalendarEventReminder
  4.             calendarEventReminder = BusinessObjects.CalendarEventReminder.Load(CInt(e.CommandArgument))
  5.  
  6.             'set sessionstate to store id for saving edited info
  7.             Session.Add("CalendarEventReminderId", calendarEventReminder.EventReminderId)
  8.  
  9.             'populate and show the relevant edit reminder popup
  10.             PopulateEditReminderPopup(calendarEventReminder)
  11.         End If
  12.     End Sub
  13.      Private Sub EditReminderButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles EditReminderButton.Click
  14.  
  15.         'determine which radio button is checked in order to correctly populate the reminder object
  16.         If EditRadioButton.Checked = True Then
  17.             PopulateCalendarEventReminder(EventReminderTypeEditDropDownList, PersonTypeEditDropDownList, PersonEditDropDownList, ReminderEditDropDownList)
  18.         ElseIf Edit2RadioButton.Checked = True Then
  19.             PopulateCalendarEventReminder(EventReminderTypeEdit2DropDownList, PersonTypeEdit2DropDownList, PersonEdit2DropDownList, Nothing)
  20.         End If
  21.  
  22.         'perform page validation
  23.         If Page.IsValid Then
  24.  
  25.             'save reminder
  26.             If mCalendarEventReminder.IsValid Then
  27.                 mCalendarEventReminder.IsDeleted = 0
  28.                 mCalendarEventReminder.UpdateDate = Now
  29.                 mCalendarEventReminder.Save()
  30.             End If
  31.  
  32.             'dispose of session variable holding id of reminder being edited
  33.             Session.Remove("CalendarEventReminderId")
  34.  
  35.             EditReminderModalPopupExtender.Hide()
  36.             LoadRemindersGridView()
  37.         End If
  38.  
  39.     End Sub
  40.  
  41.     Private Sub CancelEditButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CancelEditButton.Click
  42.         EditReminderModalPopupExtender.Hide()
  43.  
  44.         'dispose of session variable holding id of reminder being edited
  45.         Session.Remove("CalendarEventReminderId")
  46.     End Sub
  47.  

There are also some methods for populating the controls on the panel, and enabling and disabling them depending on selection of a radio button also on that panel.

I'd be really keen to find a solution - switching over to the popups was a drastic solution to problems i was having with another "popup" style window, and now its turning out to be just as problematic!!
Oct 1 '07 #1
1 4839
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!

Although it's an AJAX ModalPopup, you'll probably get more help with your problem in the .NET forum to which I've moved this thread (moved from JavaScript/AJAX forum).
Oct 1 '07 #2

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

Similar topics

1
2551
by: shaizaban | last post by:
hello, my question is as follows (very urgent): i generated in an aspx page a modalpopup ajax control. i inserted a user control into the panel contained in the popup control. the panel contains "ok" and "cancel", with no connectio to the user control. how can i cause the popup stay visible after "ok"? any button i press causes the popup to disappear!!! is there a way for it???
2
5674
by: =?Utf-8?B?c3Jpbml2YXM=?= | last post by:
Hi All, I'm having a grid view(GridView1) with a hyperlink column.It's ID is Link1 I want to show a popup on hyperlink click. I'm using ajaxToolkit:ModalPopupExtender for that. But when i'm using TargetControlID="Link1" for ajaxToolkit:ModalPopupExtender I'm getting an error System.InvalidOperationException: The TargetControlID of 'ModalPopupExtender1' is not valid. A control with ID 'Link1' could not be found.
3
2493
by: =?Utf-8?B?UnlhbiBTbWl0aA==?= | last post by:
I have a form that has a ModalPopupExtender on it. I have un updatepanel on a panel control that is displayed when an Button (outside of the update panel) is clicked. What I am trying to do is fire the updatepanel with a command like "show_first" so that I can display appropriate informaiton in the updatepanel when the Button is clicked. I need to access the Button's click event Server Side so i can show the appropriate information. I...
1
2783
by: Jamie Sutherland | last post by:
Hi , On my page I have updatepanel 2 buttons, 2 modalpopup extenders panel with a updatepanel and some textboxes in it. I want to use the 2 buttons to open the same panel using the modalpopup extenders. My question is how do i go about this as I can only get the first button to
4
6025
by: pablorp80 | last post by:
Hello, Here is what I need: I need the focus and the cursor set to a textbox named txtGT, every time no matter if it is the first page load or whether it is a postback. Here is the problem: I am using AJAX and MasterPages as well as an update panel, the textbox is in a panel. I have tried to do it using different java scripts but I can't get it to work because I am not using asp forms, instead I am using Containers. Here is my code:...
1
1766
by: db007 | last post by:
Hi, I have a problem with a current project and the scroll position. I have an AJAX enabled website using Visual Studio 2005 and ASP.Net 2.0. The project also uses masterpages. On the page in question, there is a search section in an AJAX update panel, situated on the left hand side. Upon submitting criteria and pressing a button, the results are displayed on the right hand side of the page.
1
5209
by: mistryman06 | last post by:
Hi, I'm new to the ASP.NET Ajax. Im struck with an issue. Im having a tabcontainer with 3 tabs. Each tab has a user control (all 3 tab has the same user control) & the user control has a Button & ModalPopup Extender. While running the application, When I click the TAB1's Button i get a modalpopup in the page. But when i select the TAB2 and click on the Button. Im not getting any modalpopup in the 2nd tab rather i see the modal popup in...
0
1308
by: Heron | last post by:
Hi, I have a listbox (lstItems) that I want to populate with the items in another listbox (lstSelected) that's in a modalpopupextender. The update is supposed to happen when I close the modalpopup so I tried to add a trigger for the click event of the ok button but it seems this event is not fired anymore on serverside when it's used as the OnOkControlID for the modalpopupextender. Anyone know how to slove this?
2
4410
by: sangam56 | last post by:
Hi all. I have used modalpopup extender to popup a login from a panel. It is shown when a timer in the masterpage fires it's tick event. Everything is going ok. But each item a child page loaded the master page flickers by showing the panel i am using for the modal popup extender. I tried by making the panel invisible at page load but it shows javascript error in each page i open and also the modal popup is not popped up even when the timer...
0
8268
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
8202
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
8641
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7199
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...
1
6125
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5575
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
4093
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...
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.