K
Karen
Hi,
I'm just working on my first ASP.net site, and I'm having some problems.
In standard ASP I can easily display output based on whether any content
exists for the database field I'm displaying, but I can't seem to work
out how to do the same thing in ASP.net.
What I'm trying to do is display the content of a Dataset if it doesn't
match a particular value. I have a NavName Dataset, which contains the
name of the section of the site the user is in. If the name of the
section is Home, I don't want the name displayed. In classic ASP I'd
use:
<% if DSNavName.FieldValue("Navname") <> "home" then
response.write "<h1>"
response.write DSNavName.FieldValue("Navname")
response.write "</h1>"
end if %>
But if I try to use a varient on this I get an error message. Do I need
to put this into an "asp:" type block?
Sorry if this seems a really basic question!
Karen
I'm just working on my first ASP.net site, and I'm having some problems.
In standard ASP I can easily display output based on whether any content
exists for the database field I'm displaying, but I can't seem to work
out how to do the same thing in ASP.net.
What I'm trying to do is display the content of a Dataset if it doesn't
match a particular value. I have a NavName Dataset, which contains the
name of the section of the site the user is in. If the name of the
section is Home, I don't want the name displayed. In classic ASP I'd
use:
<% if DSNavName.FieldValue("Navname") <> "home" then
response.write "<h1>"
response.write DSNavName.FieldValue("Navname")
response.write "</h1>"
end if %>
But if I try to use a varient on this I get an error message. Do I need
to put this into an "asp:" type block?
Sorry if this seems a really basic question!
Karen