Quote:
|
<% (Session("MM_Username")) = ("UsrNm") THEN %><a href="editbook.asp?id=<%=(rstBookList.Fields.Item( "IDbk").Value)%>">Edit</a><% END IF %>
|
Doesn't that throw an error? There's no IF statement...
Take out the lines:
Dim UserNm
UsrNm = rstBookList.Fields.Item("UserName").Value
They're not needed.
Then modify it to look like this:
Code:
<% If Session("MM_Username") = rstBookList.Fields.Item("UserName").Value THEN %>
<a href="editbook.asp?id=<%=(rstBookList.Fields.Item("IDbk").Value)%>">Edit</a>
<% End If %>
Then with any luck it should work
The way you were doing it, by setting UserNm at the top, the value of UserNm would only ever hold the value of the first record returned. You would of needed to put it inside the loop and set it each time for that to work. However the way I've shown you eliminates the need for a variable - we just compare the values directly at the time.
Secondly, ("UsrNm") is not a variable - it's a litral cos it's in quotes. The correct way should be
If Session("MM_Username") = UsrNm Then
However, as I stated before, I eliminated the need for a variable.
|