473,226 Members | 1,418 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,226 software developers and data experts.

Ajax ModalPopup panel just shows at bottom of the page

i have been trying (and sometimes succeeding) to use the modalpopupextender 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 4782
acoder
16,027 Expert Mod 8TB
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
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...
2
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...
3
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...
1
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...
4
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...
1
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...
1
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 &...
0
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...
2
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.