473,499 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp panel : How to make it pop up in the centre of the page when run

69 New Member
Hi Guys,

I have an asp panel,an associated drag panel extender, a label and an OK button that serves as a message popup. i would like this pop up to show up in the centre of the browser window when the page is run.

can someone please help me
My code is below. i am using master pages

Expand|Select|Wrap|Line Numbers
  1. <asp:Panel ID="MessagePanel" runat="server" Style="z-index: 100;
  2. left: 50%; position: absolute; top: 50%;"  Visible="False" CssClass="modalPopup" Wrap="false">
  3.                             <table>
  4.                                 <tr>
  5.                                     <td style="width: 100%; text-align: center">
  6.                             <asp:Label ID="lblMessagePanel" runat="server"></asp:Label></td>
  7.                                 </tr>
  8.                                 <tr>
  9.                                     <td style="width: 100%; text-align: right">
  10.                             <asp:Button ID="btnOkPanel" runat="server" OnClick="btnOkPanel_Click" Text="OK" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" Font-Names="Arial" Font-Size="10pt" Width="38px" /></td>
  11.                                 </tr>
  12.                             </table>
  13.                             <cc1:DragPanelExtender  DragHandleID="messagePanel" ID="DragPanelExtender1" runat="server" TargetControlID="MessagePanel">
  14.                             </cc1:DragPanelExtender>
  15.                         </asp:Panel>
  16.  
  17.  
Sep 23 '08 #1
6 11228
Frinavale
9,735 Recognized Expert Moderator Expert
You'll have to write JavaScript that centers it in the middle of the page.
You could look into using the Animation extender to help you do this.

-Frinny
Sep 23 '08 #2
phpmel
69 New Member
the pop up is just a sort of confirmation box that has a message and an ok button. Can you please elaborate or show me some kind of example
Sep 23 '08 #3
Frinavale
9,735 Recognized Expert Moderator Expert
the pop up is just a sort of confirmation box that has a message and an ok button. Can you please elaborate or show me some kind of example

When does your confirmation box appear?
(This will determine how I answer your question)
Sep 23 '08 #4
phpmel
69 New Member
I am adding data to a table in the code behind and then i attempt to set the text of the label in the panel to "The record was successfully saved" and then pop up the panel as a sort of message box.
Sep 23 '08 #5
Frinavale
9,735 Recognized Expert Moderator Expert
I am adding data to a table in the code behind and then i attempt to set the text of the label in the panel to "The record was successfully saved" and then pop up the panel as a sort of message box.

Try following the example outlined in the Animation Sample found in the AjaxControlToolKit Samples.

Instead of using a regular AnimationExtender you'll want to look into using the UpdatePanelAnimation ...changing the Animation code to use the OnLoad instead of the OnClick.


If this doesn't work for you, I'll help you write some JavaScript that changes the position of the panel (<div>) to be "absolute" and change the location of the panel to the center of your browser....(this version is not fun)
Sep 23 '08 #6
kiran143
2 New Member
actually i have not tried panel but i have a javascript code

function pop()
{
window.showModalDialog(Name of the file to be opened as a POPUP.aspx',null,'status:no;dialogWidth: ;dialogHeight: ;dialogHide:true;help:no;scroll:yes');
}

in page load Call the Java script

ButtonId.Attributes.Add("OnClick", "javascript:pop();");
Sep 24 '08 #7

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

Similar topics

0
1033
by: ebbyfish | last post by:
Howdy, I am having some problems woth sizers adding panels to a scrolledwindow. I have 3 classes (wx.Panels) which I want to add to a ScrolledWindow (The Parent). I can get it to work except...
0
1447
by: Raymond Dynowski | last post by:
I have a custom image that I draw to a picture box. The image is too big to view, so I put the picture box within a panel, so that I can scroll around the image, so far so good. I would like to...
3
4074
by: Raymond Dynowski | last post by:
How do you force a panel to scroll in code. I have a large picture box inside my panel. I would like the panel to default to the centre of the screen, rather than the scrollbars showing the top...
3
1874
by: Harry | last post by:
Hi, Can anyone help. I have a asp.net page (c#), with two panels, both of which have asp:textboxes on. When I press the first button, the second panel shows fine. When I press the button in...
9
3161
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected......
9
7358
by: Kevin | last post by:
I would like to print the panel control. The panel controls contains images and lables. If i can capture as image i can use it for other purposes like Zooming etcc.. Any body have any idea...
3
1864
by: velu | last post by:
How to Pass Panel visibility property to other page? I have a scenario here. I have created a user control that has a button and panel visible set to false. When I click the button if the...
1
2133
by: clintonG | last post by:
I'm having a problem maintaining state with a Panel control in a MasterPage and I need help thinking through this process. The basic structure of the HTML in the Master looks like this... ...
1
4814
by: mbruyns | last post by:
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...
0
7014
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
7180
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,...
0
7229
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...
1
6905
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
7395
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
3108
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...
0
3103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
667
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.