:
: See I know it will not show the username and pass but the it will show
: the HTML text
: so what I did is I made 2 HTML table namely : for eg.
:
: TABLE_show shows all the 3 fields url, Username and password
: url_table shows only the URL
: now what I need is if username and password exists I want asp code to
: show me TABLE_Show
: and if the username and pasword doesn't exist I want the asp code to
: show me the URL_TABLE
: what I wrote is this :
: sUsername = rs.fields.item("theUsername").Value
: sPassword = rs.fields.item("thePassword").Value
: sURL = rs.Fields.Item("URL").Value
: If sUserName and sPAssword <> "" THEN
: <table>
: <tr>
: <td>
: response.write "Your URL is " & sURL& "<br>"
: Response.Write "Your username is " & sUsername & "<br>"
: Response.Write "Your username is " & spassword & "<br>"
: <td>
: </tr>
: </table>
: <% ELSE %>
: <table>
: <tr>
: <td>
: response.write "Your URL is " & sURL& "<br>"
: <td>
: </tr>
: </table>
: <% END IF %>
dim szURL, szUN, szPW ' --- url, username and password strings
dim tTop, tBot ' --- table top, table bottom
dim szTable ' --- table string
sUsername = rs.fields.item("theUsername").Value
szUN = "Your username is "
sPassword = rs.fields.item("thePassword").Value
szPW = "Your password is "
sURL = rs.Fields.Item("URL").Value
szURL = "Your URL is "
tTop = "<table><tr><td>"
tBot = "</td></tr></table>"
If sUserName and sPassword <> "" Then
szTable = tTop & szURL & sURL & "<br />" & szUN & sUsername & "<br />" &
szPW & spassword & "<br />" & tBot
else
szTable = tTop & szURL & sURL & "<br />"
end if
Response.Write(szTable)
However, this would be easier on the client-side:
<script type="text/javascript">
function untest() {
if('<%sUsername%>' == '' && '<%sPassword%>' == '') {
} else {
document.getElementById('2').style.display='block';
document.getElementById('3').style.display='block';
}
}
</script>
<body onload="untest()">
<table><tr><td>
<div id=1>Your URL is <%=sURL%></div>
<div id=2 style="display: none">Your username is <%=sUsername%></div>
<div id=3 style="display: none">Your password is <%=sPassword%></div>
</td></tr></table>
--
Roland
This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
-Technet Knowledge Base-
http://support.microsoft.com/default.aspx?scid=fh;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0
-Technet Script Center-
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp
-MSDN Library-
http://msdn.microsoft.com/library/default.asp