Bob Burns
07-16-2004, 05:49 PM
Hi,
I am dynamically creating a table that contains links and images in my asp.net code as follows
sub page_load(sender, event_args)
{
Dim record_set As System.Data.SqlClient.SqlDataReader
record_set = command.ExecuteReader
Dim strBuilder As System.Text.StringBuilder
strBuilder.Append("<Table cellspacing= cellpadding>")
strBuilder.Append("<tr><td>")
strBuilder.Append("<a href= ' "& record_set.GetString("URL_LOCATION") &" ' onmouse = 'changeLinkColor( "& strLinkID&" )' id =' hello_name '>")
strBuilder.Append(" Google ")
strBuilder.Append("</a>")
literal_html_component_accessible_in_asp.InnerHtml = strBuilder.ToString()
}//end of page_load
my javascript code is
<script language="Javascript">
function changeLinkColor(link_ID)
{
document.getElementByID(link_ID).style.Color="ffff00"
}//end of function
</script>
for some bizzare reason when I pass in the argument link_ID into the javascript function is value isn't what its supposed to be, can anyone spot something wrong with my code syntax??
Thanks Bob
I am dynamically creating a table that contains links and images in my asp.net code as follows
sub page_load(sender, event_args)
{
Dim record_set As System.Data.SqlClient.SqlDataReader
record_set = command.ExecuteReader
Dim strBuilder As System.Text.StringBuilder
strBuilder.Append("<Table cellspacing= cellpadding>")
strBuilder.Append("<tr><td>")
strBuilder.Append("<a href= ' "& record_set.GetString("URL_LOCATION") &" ' onmouse = 'changeLinkColor( "& strLinkID&" )' id =' hello_name '>")
strBuilder.Append(" Google ")
strBuilder.Append("</a>")
literal_html_component_accessible_in_asp.InnerHtml = strBuilder.ToString()
}//end of page_load
my javascript code is
<script language="Javascript">
function changeLinkColor(link_ID)
{
document.getElementByID(link_ID).style.Color="ffff00"
}//end of function
</script>
for some bizzare reason when I pass in the argument link_ID into the javascript function is value isn't what its supposed to be, can anyone spot something wrong with my code syntax??
Thanks Bob