|
Rank: Member Groups: Member
Joined: 5/10/2009 Posts: 16
|
I am using the EO Dialog control for one day now. I am very glad with the features but can't find the way how to use it in case of a cancel/accept button. Theses are my questions: 1) I've added two standard buttons within the footer template editor. While I've configured the dialog to use the standard 'dark_blue' template, the background of the footer shows transparent. How can I get the footer to show the same background as the header and contentframe? 2)I've prepared a very simple aspx page with a label1, button1 and the dialog1 control. My codehandling is included within the Button1_Click event in VB.NET. This Subroutine holds the statement to show the Dialog1 control and also the coding for the processing after that one of the buttons has been pressed. Since the Subroutine starts by displaying the Dialog1 control in modal mode I expected the code to wait for the yes/no button click and proceed to evaluate which of the buttons had been pressed but it shows that the code after the Dialog1.InitialState = EO.Web.DialogState.Visible statement is run directly, hence it doesn't wait for the unloading of the Dialog control. I guess that I'm missing something basically to be configured, but what? I think this is the most basic way to use a yes/no dialog but I can't figure out how to force the right sequence of handlings. This is my VB.NET button_click routine:
Code: Visual Basic.NET
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim userPressedYes As Boolean
Dialog1.InitialState = EO.Web.DialogState.Visible
Label1.Text = "I've passed the dialog already"
'Here we need to evaluate whether the user has pressed at the 'yes' of 'no' button
If userPressedYes Then
'do something
Else
'do something
End If
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dialog1.InitialState = EO.Web.DialogState.Hidden
End Sub
3) See my Button_click routine within 2). How can I verify which one of the buttons has been pressed? What do I need to code there? Since all of my processing is handled within VB.NET coding I need the verification also to be done within VB.NET, hence no Javascript. I've been through all Dialog examples and support threads but was surprised that I couldn't find a small VB.NET example showing the basic use of the Dialog control in case of a yes/no verification. Please help. Regards, Oscar
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We have just posted a new build (The new build is .79, the previous one is .72) that included a new MsgBox control, you can download the new build from our download page.
The MsgBox control is based on the dialog control but it includes additional features/samples that are specifically tailored for situation like yes/no verification. Because it is based on the dialog control, pretty much everything about the dialog still applies to the MsgBox control. The main difference is that you will not be customizing the ContentTemplate/FooterTemplate for a MsgBox, instead you customize the message and buttons.
You can take a look of the new control and see if it fits your need. If it doesn't, you can still use the dialog control. This comes back to your original questions:
1. You can modify the dialog's FooterStyleActive/FooterStyleInactive to change the background color for the footer area;
2. You will need to change your code so that Button1_Click returns immediately after display the dialog, then add a separate handler (for example OK_Click) to handle the OK button event. That way when user clicks Button1, your dialog is displayed (and that's it, you do not wait for the result here). Next when user clicks OK button, your OK_Click is called, you can then perform whatever you would like to do there. Note the code is split into two handlers instead of one. This way you do not need to check which button is clicked because a different event handler is called for a different button;
Hope this helps. Please feel free to let us know if you have any more questions.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 5/10/2009 Posts: 16
|
Thanks a lot for your quick reply. I will also test the new msgbox control.
I've followed your approach with respect to the coding and that worked. Thanks you very much!
I've set the background color for both FooterStyleActive and FooterStyleInactive to #47729F (dark blue like the first template) within the object editor but the footer still shows transparant between the two buttons. I've also tried to set it within VB.NET but that also failed. Within the HTML source the CSStext tag of FooterStyleActive and also of ContentStyleActive shows the same. So it looks like it isn't possible to change the background color specifically for the footer by no means.
Another question : How can I enter a line feed within the contentURL? In case I use chr(13) & chr(10) or vbcrlf between any words it doesn't work
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You can definitely change the backcolor. Please post your footer content and we will be happy to take a look. You can also try in another blank page (no master page, no other controls) first, and then start from scratch by putting a single button into the footer area. It occurs rather often that a user css file would interfere with our controls. So if it works in a separate page, then it is most likely has to do with your page contents and styles. You can compare the two pages and see if you can locate the difference. If it does not work in the new blank page either, you can post that page and we will take a look and see what we can find. You will never put a line feed in any Url directly, just like you won't be able to enter a line feed in Internet Exprloer's address bar. A Url with a line feed is an invalid Url and no browser will take it. If you do need to put some special characters there, you have to encode it first. .NET has this function for you to encode a Url: http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.urlencode.aspxBTW: Why do you want to put a line feed in a Url? Thanks!
|
|
Rank: Member Groups: Member
Joined: 5/10/2009 Posts: 16
|
Hi EO,
thanks for your quick reply again. I already had draft a new website and a new aspx page in VS2008 in order to find the cause why the footer background color can not be changed. It is quite strange that the footer section doesn't show itself with the same background as the header and content basically. I will try your suggestion also.
With respect to the request for the line feed I think I've mislead you by stating the contentURL property while I needed to adress the Dialog1.ContentHtml property. Basically I don't need to encode an URL at all. Sorry for that. I need to display a string within the contentframe which holds some words which I want to separate from each other by displaying them one word at one line, such as "You have forgotten to enter your " & vbcrlf & "name" & vbcrlf & "adress" & vbcrlf & "city" & vbcrlf & "age". That's why I wanted to use the line feed characters within the contentHTML property.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You will have to use <br /> for line feed with HTML.
For the footer color problem, it will be much easier if you post your .aspx source so that we can take a look. The purpose of the FooterTemplate is for you to put whatever HTML there. So there is absolutely no reason that you can not change it.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 5/10/2009 Posts: 16
|
Hi eo_support, the <br /> addition has solved the problem for the line feeds. Many thanks for that. I've included the HTML source of a small aspx file which has been created after editing the Dialog control and added a yes and no button within the object footer editor and set the background color of the footer to dark blue. I hope you can see the cause for this problem.
Code: HTML/ASPX
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register assembly="EO.Web" namespace="EO.Web" tagprefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
</style>
<script language="javascript" type="text/javascript">
</script>
</head>
<body bgcolor="#ffffcc">
<form id="form1" runat="server">
<div>
<eo:Dialog ID="Dialog1" runat="server" BackColor="#47729F"
ContentHtml="Are you sure you want to proceed?" ControlSkinID="None"
HeaderHtml="Test Dialog" Height="100px"
style="z-index: 1; left: 10px; top: 15px; position: absolute"
Width="168px" AcceptButton="Button2" AcceptButtonPostBack="True"
CancelButton="Button3" CancelButtonPostBack="True">
<FooterTemplate>
<asp:Button ID="Button2" runat="server"
style="z-index: 1; left: 21px; top: 12px; position: absolute" Text="Yes"
Width="40px" />
<asp:Button ID="Button3" runat="server"
style="z-index: 1; left: 108px; top: 12px; position: absolute" Text="No"
Width="40px" />
</FooterTemplate>
<HeaderStyleActive CssText="border-right: #22456a 1px solid; padding-right: 4px; border-top: #ffbf00 3px solid; padding-left: 4px; font-weight: bold; font-size: 11px; padding-bottom: 2px; color: white; padding-top: 2px; border-bottom: #22456a 1px solid; font-family: verdana" />
<FooterStyleActive CssText="background-color:#47729f;border-bottom-color:#22456a;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#728eb8;border-left-width:1px;border-right-color:#22456a;border-right-style:solid;border-right-width:1px;border-top-color:#7d97b6;border-top-style:solid;border-top-width:1px;color:white;font-family:verdana;font-size:11px;padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" />
<FooterStyleInactive CssText="background-color:#47729f;" />
<ContentStyleActive CssText="border-right: #22456a 1px solid; padding-right: 4px; border-top: #7d97b6 1px solid; padding-left: 4px; border-left-width: 1px; font-size: 11px; border-left-color: #728eb8; padding-bottom: 4px; color: white; padding-top: 4px; border-bottom: #22456a 1px solid; font-family: verdana" />
</eo:Dialog>
</div>
<asp:Label ID="Label1" runat="server" BackColor="Blue" ForeColor="White"
style="z-index: 1; left: 21px; top: 206px; position: absolute; width: 264px; bottom: 576px; height: 24px"
Text="Label"></asp:Label>
<p>
</p>
<asp:Button ID="Button1" runat="server"
style="z-index: 1; left: 25px; top: 327px; position: absolute; height: 27px; width : 60px;"
Text="Button" UseSubmitBehavior="False" />
<p>
</p>
<p>
</p>
</form>
</body>
</html>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, Please change your FooterTemplate to:
Code: HTML/ASPX
<div style="text-align:center">
<asp:Button ID="Button2" runat="server"
Text="Yes"
Width="40px" />
<asp:Button ID="Button3" runat="server"
Text="No"
Width="40px" />
</div>
The problem in your code is that you have the following attribute in your FooterTemplate for your OK and Cancel button:
Code: HTML/ASPX
style="z-index: 1; left: 21px; top: 12px; position: absolute"
When you set an element to "absolute", it is taken out of the page's normal layout flow. So when the browser calcuates the layout for the dialog, it would calculate as if there is nothing in the dialog's footer. As a result, you get an empty footer with the two buttons hanging below it, not inside it. The above code should solve the problem for you, note it also includes: 1. An outer DIV element with style="text-align:center". This is to center align your buttons; 2. " " between the two buttons. This creates the space between the two buttons; Hope this helps. Please feel free to let us know if you have any more questions. Thanks!
|
|
Rank: Member Groups: Member
Joined: 5/10/2009 Posts: 16
|
Thanks for your excellent help. After changing the position seeting, the background color is there where it belongs now. All my questions have been answered in a short while and with the right knowledge, great support. Never expected to get support at sunday at all.
I am going to purchase the whole control set now.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Great to hear that. We are glad that we can help!
|
|