Hi Fernando,
As for the problem you mentioned, it is a general databinding scenario in
asp.net. First , we should see that the asp.net has completely different
programming model with the classic asp. In asp, we render all the html code
manually via script code. In asp.net, we using Databinding mechanism when
we need to display list of datas retrieved from db and contained in a
certain recordcontainer(dataset or datareader). And there're some buildin
controls for databinding display ,(datagrid/datalist/repeater). What we
need to do is specifying the databinding expression in the control's
template and assign the datasource at runtime. The asp.net databinding
expression is something like:
<%# data binding expression %>
#Data Binding Expression Syntax
http://msdn.microsoft.com/library/de...us/cpgenref/ht
ml/cpcondatabindingexpressionsyntax.asp
and we can define our own helper functions in page class and call them in
the <%# %> binding block. So as for the problem you mentioned , we can
define a helper function in the code behind such as string
checkValue(object)
{
if(object is dbnull)
return otherthing
else
return url
}
and call it in repeater's template as below:
<ItemTemplate>
..
<%# checkValue(DataBinder.Eval(..)) %>
..
</ItemTemplate>
Hope helps. If you have anything else unclear, please feel free to post
here.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)