Web Connection 5.0
Re: Variable Reference in Repeater
10/06/2008
05:28:43 AM
2HC0BQQP1 Show this entire thread in new window
From:
Jim Day
To:
Rick Strahl
Attachments:
None

This is the code I used to pull the actual field names assigned from the page
DIMENSION laVars[1,2]
lnVars = Request.aFormVars(@laVars)

This is the code I use to pull the values entered

lcActiveID = this.RepPlayer.UniqueId+ "_cboLevel_"+TRANSFORM(lnx)
lcLevel = Request.Form(lcActiveId)
IF lcLevel = "None"
lcLevel = ""
ENDIF
*lcActiveID = this.RepPlayer.UniqueId+ "_cboTeam_"+TRANSFORM(lnx)
lcActiveID = this.RepPlayer.UniqueId+ "_CTL0066_"+TRANSFORM(lnx)+"_cboTeam"
lcTeam = Request.Form(lcActiveId)

This is the code in the wcsx file
<td><ww:wwWebDropDownList ID="cboLevel" runat='server' DataTextField="Desc" DataValueField="Key"
ControlSource="Level" FirstItemText="None" FirstItemValue="None">
</ww:wwWebDropDownList>/
<td>

<% if empty(TPlayList.Pass_Prt) %>
<ww:wwWebDropDownList ID="cboTeam" runat='server' DataTextField="Desc" DataValueField="Key"
ControlSource="Team" FirstItemText="None" FirstItemValue="None">
</ww:wwWebDropDownList>
<% endif %>
<% if !empty(TPlayList.Pass_Prt) %>
<ww:wwWebLabel runat="server" id="txtTeam" width="80px" ControlSource="TCode" />
<% endif %>

Without the if statement this code works
lcActiveID = this.RepPlayer.UniqueId+ "_cboTeam_"+TRANSFORM(lnx)
lcTeam = Request.Form(lcActiveId)

I question is how do I know to use "_CTL0066_" and will that number change as I edit the page or recompile the page.

Another question is that originally I tried the above with an "ELSE" statement but it did not work.

Is it correct to have to use two "IF" statements, instead of an "IF ELSE" statement.


Thanks,

Jim


Sorry I don't understand the issue... you need to clarify what you're doing.


+++ Rick ---


To pull the values on a drop down list within an "If" statement
I need to use the second command below instead of what I would use without the "IF" statement.

*lcActiveID = this.RepPlayer.UniqueId+ "_cboTeam_"+TRANSFORM(lnx)
lcActiveID = this.RepPlayer.UniqueId+ "_CTL0066_"+TRANSFORM(lnx)+"_cboTeam"

The question is how do I know what number to use? (I pulled page variables into laVars to figure it out)

Will the CTL0066 change if I make changes to the page.

Thanks,

Jim