T
tenaka2k
OK I have poked around and have not found an answer to my problem . I
have a repeater that in it's <ItemTemplate> calls a function I want to
pass the current values from the repeater to the function. I have yet
to Figgure out how to get the Evals Data to goto the function as the
current code does not work. Producing an error of :
"System.InvalidOperationException: Databinding methods such as Eval(),
XPath(), and Bind() can only be used in the context of a databound
control."
Any Help Would keep me out of the lonney bin
Thanks in advance.
This is the repeater
------------------------------------------------------------------------------------------------------------------------------------
<asp:Repeater ID="R2" runat="server" DataSourceID="SqlDataSource2" >
<HeaderTemplate>
<table border=0>
<br />
<br />
<tr>
<td align=left>
</HeaderTemplate>
<ItemTemplate>
<%Answers(Eval("AnswerType"),eval("AnswerID"),Eval("Answer"))%>
</ItemTemplate>
<FooterTemplate>
</td>
</tr>
</table>
</FooterTemplate>
</asp:Repeater>
--------------------------------------------------------------------------------------------------------------------------------
And this is the function.
--------------------------------------------------------------------------------------------------------------------------------
Protected Sub Answers(ByVal At As String, ByVal AI As String, ByVal A
As String)
output = ""
Select Case AT
Case "radio"
output = output & "<input id=""RB"" type=""radio""
name=""" & AI & """ value=""" & A & """ />" & A & "<br />"
Case "text"
output = output & "<input id=""RB"" type=""text""
name=""" & AI & """ value=""" & A & """ /> <br />"
Case "other"
output = output & "<input id=""RB"" type=""radio""
name=""" & AI & """ value=""" & A & """ />" & A & "<br /> <input
id=""RB"" type=""text"" name=""" & AI & """ value=""" & A & """ /> <br
/>"
Case "list"
End Select
Response.Write(output & vbCrLf)
End Sub
have a repeater that in it's <ItemTemplate> calls a function I want to
pass the current values from the repeater to the function. I have yet
to Figgure out how to get the Evals Data to goto the function as the
current code does not work. Producing an error of :
"System.InvalidOperationException: Databinding methods such as Eval(),
XPath(), and Bind() can only be used in the context of a databound
control."
Any Help Would keep me out of the lonney bin
This is the repeater
------------------------------------------------------------------------------------------------------------------------------------
<asp:Repeater ID="R2" runat="server" DataSourceID="SqlDataSource2" >
<HeaderTemplate>
<table border=0>
<br />
<br />
<tr>
<td align=left>
</HeaderTemplate>
<ItemTemplate>
<%Answers(Eval("AnswerType"),eval("AnswerID"),Eval("Answer"))%>
</ItemTemplate>
<FooterTemplate>
</td>
</tr>
</table>
</FooterTemplate>
</asp:Repeater>
--------------------------------------------------------------------------------------------------------------------------------
And this is the function.
--------------------------------------------------------------------------------------------------------------------------------
Protected Sub Answers(ByVal At As String, ByVal AI As String, ByVal A
As String)
output = ""
Select Case AT
Case "radio"
output = output & "<input id=""RB"" type=""radio""
name=""" & AI & """ value=""" & A & """ />" & A & "<br />"
Case "text"
output = output & "<input id=""RB"" type=""text""
name=""" & AI & """ value=""" & A & """ /> <br />"
Case "other"
output = output & "<input id=""RB"" type=""radio""
name=""" & AI & """ value=""" & A & """ />" & A & "<br /> <input
id=""RB"" type=""text"" name=""" & AI & """ value=""" & A & """ /> <br
/>"
Case "list"
End Select
Response.Write(output & vbCrLf)
End Sub