Hi
I have used your Dialog control successfully on an ongoing project but have recently run into a strange problem I'm hoping you can assist with.
I am using VB.Net. The dialog is created in the aspx file and made visible from the codebehind file.
I have until now not explicitly set the AnchorElementID, XOffset, YOffset and ShowDirection properties and opted for the default location. This was fine until I have added new functionality that dynamically adds new controls based on a dropdown value. When the new controls are rendered on the page, the vertical size of the page increases significantly. The control that triggers the dialog to appear is near the bottom of the page.
Now when the dialog is triggered and made visible, the screen scrolls to the top, and then scrolls slightly down so that only a small part of the dialog shows. To show the full dialog, the user would have to scroll the page up to the top manually.
To try to overcome this I tried calling the following Javascript from the ClientSideOnInitDialog property.
Code: JavaScript
function DialogScroll() { window.scroll(0, 0);alert('test');}
As you can see I dropped in a test alert and this definitely fires successfully. However the window scrolls to the top and back down again still cutting off the top of the dialog.
I also then tried experimenting with the AnchorElementID, XOffset, YOffset and ShowDirection properties. What I seemed to discover is that within the first 'screenful' of the page, these values seem to make a diffence but if the values entered fall beyond the height of one screen, they are ignored and it defaults to the edge of the first 'screenful'
What I am hoping I can do when the dialog is made visible is either:
1) Scroll to the top of the page and then show the dialog centered on the screen. When the dialog is dismissed I would then set focus on the original form control and set the window scroll position separately
or
2) Have the dialog anchored to the control that effectively triggered it, regardless of the window height.
Code example is below:
Aspx page
Code: HTML/ASPX
<eo:Dialog ID="NoRecords" runat="server" BorderStyle="Solid" BorderWidth="1px" BackShadeColor="LightGray"
BackShadeOpacity="50" BorderColor="#728EB8" ControlSkinID="None" ShadowColor="LightGray"
ShadowDepth="4" HeaderHtml="Savings Account Application Message" Height="120px"
Width="268px" BackColor="White">
<HeaderStyleActive CssText="padding-right: 10px; padding-left: 10px; font-size: 12px; font-weight: bold; background-image: url(00070202); padding-bottom: 2px; padding-top: 2px; font-family: arial" />
<ContentStyleActive CssText="padding-right: 10px; padding-left: 10px; font-size: 11px; padding-bottom: 10px; padding-top: 10px; font-family: verdana; background-color: #f8fafd" />
<FooterStyleActive CssText="padding-right: 10px; padding-left: 10px; font-size: 11px; padding-bottom: 10px; padding-top: 4px; font-family: verdana; background-color: #f8fafd" />
<ContentTemplate>
<p>
No records have been found for the entered Sortcode and Account Number.</p>
<p>
Please check for errors and try entering the Sortcode and Account Number again.</p>
<p>
Alternatively you may enter your bank details manually. Please ensure you enter
your Sortcode and Account Number exactly as they appear on your bank card or chequebook.</p>
</ContentTemplate>
<FooterTemplate>
<asp:Button ID="NoRecordsOkButton" runat="server" Text="OK" CausesValidation="false" />
</FooterTemplate>
Code behind page:
Code: Visual Basic.NET
If dsBankValidate.Tables.Count = 0 Then
NoRecords.InitialState = EO.Web.DialogState.Visible
......
Protected Sub NoRecordsOkButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles NoRecordsOkButton.Click
'Close Dialog and return focus to Sortcode field
NoRecords.InitialState = EO.Web.DialogState.Hidden
SetFocusOnLoad(Sortcode_TextBox)
End Sub
Sorry for the long post....hopefully I've described the problem sufficiently.
Many thanks in advance.
Darren