<ww:wwWebMailLink ID="MailLink1" runat='server' EmailControlSource ="po.email" ControlSource ="po.username" />
<br />
<%= po.email%><br />
<%= po.username%>
And this is my code:
FUNCTION OnLoad()
public po
po = createobject('session')
po.addproperty('username','Some user')
po.addproperty('email','test@test.com')
this.databind()
ENDFUNC
* Onload
Please note that I updated the original message to not depend on external data. This code should work as is, as far as I have understood from the documentation.
Not sure.
This works fine for me:
- Create a new page
- Add a mail control
- Add properties to the page to bind to
Then:
<label>Email Address:</label>
<ww:wwWebMailLink runat="server" ID="lnkEmail" ControlSource="this.Page.cName" EmailControlSource="this.Page.cEmail" />
and the code in the code behind:
*****************************************************************
DEFINE CLASS Default_Page as WWC_WEBPAGE OF WWC_WEBPAGE_FILE
*****************************************************************
*** Your Implementation Page Class - put your code here
*** This class acts as base class to the generated page below
*****************************************************************
#IF .F.
*** This line provides Intellisense: Ensure your path includes this page's location
LOCAL this as Default_Page_WCSX of default_page.prg
#ENDIFcEmail = "rstrahl@west-wind.com"
cName = "Rick Strahl"*****************************************************************
* OnLoad
****************************************
FUNCTION OnLoad()this.lnkEmail.DataBind()
ENDFUNC
* Onload
...ENDDEFINE
This works fine.
Note that you may have to explicitly bind the mail control instead of using DataBind() on the form because this control has to be always bound, not just on the first run through (if !IsPostBack).
+++ Rick ---
I can't get this control to work, and I don't find any working sample to compare with. To test I created a very simple web form. Here's the important part of my wcsx:
<ww:wwWebMailLink ID="MailLink1" runat='server' EmailControlSource ="po.email" ControlSource ="po.username" />
<br />
<%= po.email%><br />
<%= po.username%>
And this is my code:
FUNCTION OnLoad()
public po
po = createobject('session')
po.addproperty('username','Some user')
po.addproperty('email','test@test.com')
this.databind()
ENDFUNC
* Onload
Please note that I updated the original message to not depend on external data. This code should work as is, as far as I have understood from the documentation.
West Wind Technologies
Making waves on the Web
from Maui
Not sure.
This works fine for me:
- Create a new page
- Add a mail control
- Add properties to the page to bind to
Then:
<label>Email Address:</label>
<ww:wwWebMailLink runat="server" ID="lnkEmail" ControlSource="this.Page.cName" EmailControlSource="this.Page.cEmail" />
and the code in the code behind:
*****************************************************************
DEFINE CLASS Default_Page as WWC_WEBPAGE OF WWC_WEBPAGE_FILE
*****************************************************************
*** Your Implementation Page Class - put your code here
*** This class acts as base class to the generated page below
*****************************************************************
#IF .F.
*** This line provides Intellisense: Ensure your path includes this page's location
LOCAL this as Default_Page_WCSX of default_page.prg
#ENDIFcEmail = "rstrahl@west-wind.com"
cName = "Rick Strahl"*****************************************************************
* OnLoad
****************************************
FUNCTION OnLoad()this.lnkEmail.DataBind()
ENDFUNC
* Onload
...ENDDEFINE
This works fine.
Note that you may have to explicitly bind the mail control instead of using DataBind() on the form because this control has to be always bound, not just on the first run through (if !IsPostBack).
+++ Rick ---
I can't get this control to work, and I don't find any working sample to compare with. To test I created a very simple web form. Here's the important part of my wcsx:
<ww:wwWebMailLink ID="MailLink1" runat='server' EmailControlSource ="po.email" ControlSource ="po.username" />
<br />
<%= po.email%><br />
<%= po.username%>
And this is my code:
FUNCTION OnLoad()
public po
po = createobject('session')
po.addproperty('username','Some user')
po.addproperty('email','test@test.com')
this.databind()
ENDFUNC
* Onload
Please note that I updated the original message to not depend on external data. This code should work as is, as far as I have understood from the documentation.
Inside of a control you have to use THIS.oPage because THIS is the control. On the Page you use this.cEmail.
You can also declare PRIVATE vars and reference those - that'll work as well.
FWIW... for the workshop in October we'll be focusing on scripts and templates rather than the Web control framework.
+++ Rick ---
Thanks, got it to work. What got me confused, is that sometimes I must use this.oObject and sometimes this.page.oObject. Can you give me an easy to remember rule about when to use this.page and when to use "only" this?
Not sure.
This works fine for me:
- Create a new page
- Add a mail control
- Add properties to the page to bind to
Then:
<label>Email Address:</label>
<ww:wwWebMailLink runat="server" ID="lnkEmail" ControlSource="this.Page.cName" EmailControlSource="this.Page.cEmail" />
and the code in the code behind:
*****************************************************************
DEFINE CLASS Default_Page as WWC_WEBPAGE OF WWC_WEBPAGE_FILE
*****************************************************************
*** Your Implementation Page Class - put your code here
*** This class acts as base class to the generated page below
*****************************************************************
#IF .F.
*** This line provides Intellisense: Ensure your path includes this page's location
LOCAL this as Default_Page_WCSX of default_page.prg
#ENDIFcEmail = "rstrahl@west-wind.com"
cName = "Rick Strahl"*****************************************************************
* OnLoad
****************************************
FUNCTION OnLoad()this.lnkEmail.DataBind()
ENDFUNC
* Onload
...ENDDEFINE
This works fine.
Note that you may have to explicitly bind the mail control instead of using DataBind() on the form because this control has to be always bound, not just on the first run through (if !IsPostBack).
+++ Rick ---
I can't get this control to work, and I don't find any working sample to compare with. To test I created a very simple web form. Here's the important part of my wcsx:
<ww:wwWebMailLink ID="MailLink1" runat='server' EmailControlSource ="po.email" ControlSource ="po.username" />
<br />
<%= po.email%><br />
<%= po.username%>
And this is my code:
FUNCTION OnLoad()
public po
po = createobject('session')
po.addproperty('username','Some user')
po.addproperty('email','test@test.com')
this.databind()
ENDFUNC
* Onload
Please note that I updated the original message to not depend on external data. This code should work as is, as far as I have understood from the documentation.
West Wind Technologies
Making waves on the Web
from Maui