short desc. of problem. I want to display hyperlinks with a repeater,
but add "link not available" and disable the hyperlink if the field in
DB is null.
as it is now i get:
"Compilation Error"
"Compiler Error Message: BC30201: Expression expected"
in the compiler output i get "error BC30545: Property access must
assign to the property or use its value."
at the line: Container.DataItem("SubjectName") & ": link not
available",
and i also get "error BC30205: End of statement expected" at the same
line...
can anyone see what i'm doing wrong ?
everything was working fine until i tried to add the conditional
statements (iif...)
this is my code in the itemtemplate of the repeater (except the html
tables etc)
<asp:HyperLink NavigateUrl='<%# "http://" &
Container.DataItem("Dep_WebsiteURL") %>'text='<%#
iif(Container.DataItem("Dep_WebsiteURL") is dbnull.value,
Container.DataItem("SubjectName") & ": link not available",
Container.DataItem("SubjectName")) %>'enabled='<%#
iif(Container.DataItem("Dep_WebsiteURL") is dbnull.value, false,
true)%>'Runat="server" Target="_blank" ID="Hyperlink1" /
thanks a lot...I'm kind of in a hurry here...
FredrikFredrik why don't you try doing it in your CodeBehind ?
*** Sent via Developersdex http://www.developersdex.com ***
Howdy everyone !!!
Please disregard this message ! I have solved the problem !
Thanks alot, especially "london calling" who provided me with a better
solution !!
Thanks
0 comments:
Post a Comment