JasonS
Jan 10th, 2001, 04:28 PM
I have a web page that connects to a database (SQL server) and loops through the data and generates a list of links to go to different areas of the site.
When the user clicks the link I want to write a cookie so I know whick link they selected. Here's how the link is created.
<a href="Profile.asp?Action=View&CId=<%=rs("tpClientId")%>&PId=<%=rs("tpProjectid")%>" name=tqproject language=vbscript onclick='buildname(<%Response.Write(chr(34) & rs("ptProjectDesc") & chr(34))%>)'><%=rs("ptProjectDesc")%></a>
This calls the function just fine but, using response.cookies causes an error (see below). I suppose it's something to do with client/server side processing but I don't know.
I don't want to use jscript to write the cookie (I'm using jscript in other areas just don't want to here, server seems much simpler).
I've tried without the language= and other version but can't get it to work. Here's the latest buildname function.
<script language=vbscript>
sub buildname(sName)
Response.Cookies("ProjName")=sName
end sub
</script>
I'm not using the <form> tag. Will use it if required.
I'm using ASP.
When the user clicks the link I want to write a cookie so I know whick link they selected. Here's how the link is created.
<a href="Profile.asp?Action=View&CId=<%=rs("tpClientId")%>&PId=<%=rs("tpProjectid")%>" name=tqproject language=vbscript onclick='buildname(<%Response.Write(chr(34) & rs("ptProjectDesc") & chr(34))%>)'><%=rs("ptProjectDesc")%></a>
This calls the function just fine but, using response.cookies causes an error (see below). I suppose it's something to do with client/server side processing but I don't know.
I don't want to use jscript to write the cookie (I'm using jscript in other areas just don't want to here, server seems much simpler).
I've tried without the language= and other version but can't get it to work. Here's the latest buildname function.
<script language=vbscript>
sub buildname(sName)
Response.Cookies("ProjName")=sName
end sub
</script>
I'm not using the <form> tag. Will use it if required.
I'm using ASP.