W
Wayne Wengert
I am trying to build a project in VSNET 2003 using a sql datareader and
a datalist. I want to have one column display either a hyperlink or a
simple test string based on the values in one of the data fields. I have
tried many combinations of code but cannot get it to work. My current
code is listed below. From searching google I believe thast the
DataRowView type works only with a datagrid. Any suggestions are
appreciated
============= code snippets ============
Public Function SetValue(ByVal data As DataRowView) As String
Dim strResult As String
If data("ProposedStatus") Is DBNull.Value Then
strResult = String.Format( _
"http://wengert.org/evaljudge.asp?name={0}&caption={1}&evalid={2}", _
data("JudgeName"), data("Caption"), data("EvalID"))
Else
strResult = ""
End If
Return strResult
End Function
.......
<asp
ataList id="judgelist" runat="server">
<HeaderTemplate>
<table width="90%">
<tr bgcolor="#b0c4de">
<th>
Action</th>
<th>
Judge</th>
<th>
Caption</th>
<th align="center">
Current<br />
Status</th>
<th align="center">
Proposed<br />
Status</th>
<tr>
</HeaderTemplate>
<ItemTemplate>
<tr bgcolor="lightcyan">
<td id="myLink" runat="server">
SetValue()
</td>
a datalist. I want to have one column display either a hyperlink or a
simple test string based on the values in one of the data fields. I have
tried many combinations of code but cannot get it to work. My current
code is listed below. From searching google I believe thast the
DataRowView type works only with a datagrid. Any suggestions are
appreciated
============= code snippets ============
Public Function SetValue(ByVal data As DataRowView) As String
Dim strResult As String
If data("ProposedStatus") Is DBNull.Value Then
strResult = String.Format( _
"http://wengert.org/evaljudge.asp?name={0}&caption={1}&evalid={2}", _
data("JudgeName"), data("Caption"), data("EvalID"))
Else
strResult = ""
End If
Return strResult
End Function
.......
<asp
<HeaderTemplate>
<table width="90%">
<tr bgcolor="#b0c4de">
<th>
Action</th>
<th>
Judge</th>
<th>
Caption</th>
<th align="center">
Current<br />
Status</th>
<th align="center">
Proposed<br />
Status</th>
<tr>
</HeaderTemplate>
<ItemTemplate>
<tr bgcolor="lightcyan">
<td id="myLink" runat="server">
SetValue()
</td>