Wayne, there are a couple things going on (I don't think the "not is" syntax is valid, you need to wrap the "evalid" with your same container reference, etc.), but part of the problem with doing it this way is that you can't get any help from the compiler when playing with the syntax
So, let's simplify and do it in the code-behind
Public Function GetJudge(ByVal data As DataRowView) As Strin
Dim strResult As Strin
If data("ProposedStatus") Is DBNull.Value The
strResult = String.Format(
"
http://wengert.org/evaljudge.asp?name={0}&caption={1}&evalid={2}",
data("JudgeName"), data("Caption"), data("EvalID")
End I
Return strResul
End Functio
....then, in the html
<asp:TemplateColumn HeaderText="Wayne's Column"><itemtemplate><asp:HyperLink id="Hyperlink1" runat="server" NavigateUrl= '<%# GetJudge(container.dataitem) %>' Text= "Evaluate" ></asp:HyperLink></itemtemplate></asp:TemplateColumn
Notice how container.dataitem is sent to GetJudge as a datarowview, and from there you can get whatever fields you want from the datasource. Rather than write GetJudge, you could also put similar code behind on OnItemDataBound, which would also make it easier for you to set multiple attributes (e.g. do a findcontrol from within ItemDataBound to get your hyperlink control, and then set Text, NavigateURL, Visible, etc.) at the same time if you need to. Anyway, I think you'll find what's above will work
hth
Bil
----- Wayne Wengert wrote: ----
Bill
After re-reading your post I see you specified "System.DBNull.Value". I ha
left off the ".Value" Making that change has changed the error I get, No
the compiler gives the following error
BC30455: Argument not specified for parameter 'TruePart' of 'Public Functio
IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) A
Object'
I read somewhere that the true and false parts of IIF should be strings?
am not sure what the references to Objects in the error message are
The statement I am currently trying is as follows
<asp:HyperLink id="XX" runat="server" NavigateUrl= '<%
IIF(DataBinder.Eval(Container.DataItem,"ProposedStatus") NOT I
System.DBNull.Value, "
http://wengert.org/evaljudge.asp?name="
DataBinder.Eval(Container.DataItem,"JudgeName") + "&caption="
DataBinder.Eval(Container.DataItem,"Caption") + "&evalid=" + evalID, " "
%>' Text= "Evaluate" ></asp:HyperLink
Wayn
Bill Borg said:
You should be able to use system.dbnull.value, although I've not trie
that in my example. You can also simplify the syntax a bit by using jus
*Container.Dataitem("ProposedStatus")* in place of the whol
*DataBinder.Eval(Container.Dataitem, "ProposedStatus")*, etc. And I presum
that you found you need that around your "+ evalID" too. Enjoy
I als
adjusted the code to IIF(DataBinder.Eval(Container.DataItem,"ProposedStatus"
IS NOT System.DBNull, "
http://wengert.org/evaljudge.asp?name="
DataBinder.Eval(Container.DataItem,"JudgeName") + "&caption="
DataBinder.Eval(Container.DataItem,"Caption") + "&evalid=" + evalID " "
%> to us
System.DBNull. When I do that the compiler complains tha System.DBNull is
Type and cannot be used in an expression? Catch 2 evalID, false) display a
link within want
DataBinder.Eval(Container.DataItem,"status") %> Is