I've added the ASPxPopupControl to a User Control so that I can ensure a consistent look and feel through my web application when using the popup control. I've got the popup control appearing properly thus far, but have found the MODAL setting is being ignored. Is there a solution to get around this?
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Gregory,
Thank you for the report, but it seems strange that the modal setting is ignored. The UserControl file content should be embedded into the existing ASPX page, and even if there are two separate areas, actually this is the same page with the common rendering result.
For example if you take a look at my project, you'll see that it works fine. Can you please provide a small sample which reproduces the issue, so I can reproduce it at my side and then help you as fast as possible?
Thanks,
Vest
I've attached a sample web site application with my code. i have a user control named: pcYesNo.aspx.cs. This control contains three DevExpress controls. 1. is the ASPxPopupControl which includes 2 ASPxButton controls. I've setup the button controls so I can execute them from my parent web page. If you find my code in this are not done right, I am certainly open to any better approaches you can offer. I've also created some properties so that I can change some of the controls label values as needed. The ASPxPopupControl.Modal property value is set to TRUE, yet id does not behave that way. I hardcoded the Modal value in this case, but I prefer to control it by setting up a property.
Let me know what your thoughts are. In the meantime, i am going to down load your sample and take a look at the source code when i get to work tomorrow.
Noticed I didn't include the name of the user control properly. The user control's name is pcYesNo.ascx and it's included in the Confirm.aspx web page. Thanks,
Hello Gregory,
Thank you for the sample project. I've modified it based on your idea: I simply moved the Modal property from the ASPxPopupControl markup to the code behind:
pcYesNo.ascx: <dxpc:ASPxPopupControl ID="pcYesNo" runat="server" Height="225px" PopupHorizontalAlign="WindowCenter" ClientInstanceName="pcYesNo" PopupVerticalAlign="WindowCenter" Width="420px">...</dxpc:ASPxPopupControl>
pcYesNo.ascx.cs public bool Modal { get { return this.pcYesNo.Modal; } set { this.pcYesNo.Modal = value; } }
I've also attached a modified version of your project. Please take a look at the "Default.aspx" page, where the public Modal property is declared within the page markup.
Thanks,
Vest
I downloaded your sample. I had already done whet you showed and the Modal still is not in effect. If I click anywhere outside the popup box, it disappears. Not the functionality I want. Did this sample work on your side? What else could be going on?
One additional note. Just to make sure my additional code wasn't causing any of the problems.
I added the popup control to a user control. Set the Modal=True and ShowOnPageLoad=True. Then added the user control to a blank web page. It doesn't work correctly either.
Gregory,
The ASPxPopupControl closes by default when you click outside of the popup's area: ASPxPopupControl.CloseAction. If you wish to change this behavior, and the popup should be closed via the "Close" button only, you should set this property equal to CloseButton.
I've also attached a small screencast which demonstrates this solution.
Thanks,
Vest
Thanks Vest, that helped me.
I have just a couple of more things I'd like to ask.
- This propert lets me set the ShowOnPageLoad value from the calling parent page based on setting a boolean value.
--> public bool ShowOnPageLoad {
get { return this.pcYesNo.ShowOnPageLoad; }
set { this.pcYesNo.ShowOnPageLoad = value; }
}
- This property setting for CloseAction will not work. I notice there is a CloseAction Enumerator that contains the valid values. My thinking is I would make the property an INT. But, this doesn't work. Can you advise what on how I should be setting up this property. By default, I'll have it set to CloseButton, but I would like to have control over its settting if possible from the calling parent page. (I hope my question is clear here).
--> public int CloseAction {
get { return this.pcYesNo.CloseAction; }
set { this.pcYesNo.CloseAction = value; }
}
Thank you very much for your help as I know I can now proceed with using the ASPxPopupControl as I wish.
Look forward to your reply.
Greg
Hello Gregory,
Yes, I completely agree with your understanding of the "Modal" behavior. The modal window knows its parent, and when it is shown, the parent window doesn't receive any events. On the web, the true modality appears when the alert message or the confirmation dialog is shown. All these popups are made by the browser, and in this case, the browser doesn't allow you to click its content.
In HTML documents, the modality is emulated via many tricks: all editors are hidden (disabled), some transparent objects are shown over them, and block all events, and so on. Our ASPxPopupControl simply draws a gray div between an HTML document and a popup window. It catches all events, and when you hide a button (for example) with it, you won't be able to click on it. Of course, the ASPxPopupControl can be closed in many ways, one of them is to use the ASPxPopupControl.CloseAction property. We know that this modality might be confusing to users, but in our opinion, this is the most convenient implementation.
Thanks,
Vest