asafblasberg
Programmer
Too many arguments to 'Private Function Highlight(spcShow As Object) As Object':
CODE
Private Function Highlight (spcShow As object)
If spcShow.Equals(DBNull.Value) Then
Return ""
End if
End Function
Goal: I have a datalist and I want to check for nulls, if it is null, do not display the data.
<aspataList id="displayproducts" HorizontalAlign="Center" cssclass = "gbhead" halign="center" ItemStyle-VerticalAlign="Top" itemstyle-horizontalalign= "Center" ItemStyle-Width = "300" width="100%" repeatlayout="table" runat="server">
<ItemStyle CssClass="dash"></ItemStyle>
<itemtemplate>
<p align="center">
<a href="viewproduct.aspx?pid=<%# DataBinder.Eval(Container.DataItem, ("idProduct"))%>&mcat=<%# DataBinder.Eval(Container.DataItem, ("mastercategory"))%>&id=<%# DataBinder.Eval(Container.DataItem, ("idcategory"))%>">
<asp:Image id="Image1" runat="server" src='<%# DataBinder.Eval(Container.DataItem, ("smallimageurl"))%>'>
</asp:Image></a><br>
<%# DataBinder.Eval(Container.DataItem, ("sku"))%><br>
<b><%# DataBinder.Eval(Container.DataItem, ("description"))%></b><br>
List Price: <%# DataBinder.Eval(Container.DataItem, ("listprice"), "{0:c}")%><br>
<b><font color="#CC0000">Sale Price: <%# DataBinder.Eval(Container.DataItem, ("price"), "{0:c}")%><br></font>
<b><font color="#CC0000">Special Price: <%# Highlight(DataBinder.Eval(Container.DataItem, "specialprice"), "{0:c}")%<br></font>
<span class="gbbig"><font color="#800000"><%# DataBinder.Eval(Container.DataItem, ("specialtext"))%></span>
</itemtemplate>
</aspataList>
CODE
Private Function Highlight (spcShow As object)
If spcShow.Equals(DBNull.Value) Then
Return ""
End if
End Function
Goal: I have a datalist and I want to check for nulls, if it is null, do not display the data.
<aspataList id="displayproducts" HorizontalAlign="Center" cssclass = "gbhead" halign="center" ItemStyle-VerticalAlign="Top" itemstyle-horizontalalign= "Center" ItemStyle-Width = "300" width="100%" repeatlayout="table" runat="server">
<ItemStyle CssClass="dash"></ItemStyle>
<itemtemplate>
<p align="center">
<a href="viewproduct.aspx?pid=<%# DataBinder.Eval(Container.DataItem, ("idProduct"))%>&mcat=<%# DataBinder.Eval(Container.DataItem, ("mastercategory"))%>&id=<%# DataBinder.Eval(Container.DataItem, ("idcategory"))%>">
<asp:Image id="Image1" runat="server" src='<%# DataBinder.Eval(Container.DataItem, ("smallimageurl"))%>'>
</asp:Image></a><br>
<%# DataBinder.Eval(Container.DataItem, ("sku"))%><br>
<b><%# DataBinder.Eval(Container.DataItem, ("description"))%></b><br>
List Price: <%# DataBinder.Eval(Container.DataItem, ("listprice"), "{0:c}")%><br>
<b><font color="#CC0000">Sale Price: <%# DataBinder.Eval(Container.DataItem, ("price"), "{0:c}")%><br></font>
<b><font color="#CC0000">Special Price: <%# Highlight(DataBinder.Eval(Container.DataItem, "specialprice"), "{0:c}")%<br></font>
<span class="gbbig"><font color="#800000"><%# DataBinder.Eval(Container.DataItem, ("specialtext"))%></span>
</itemtemplate>
</aspataList>