I'm trying to place some child control inside a Javascript var marqueecontent. The var marqueecontent holds the content for my custom marquee. The following is an example of the javascript. I'm only showing the relevent example code.
Dim strCode As String = "<script language=JavaScript>"
strCode += "var marqueebgcolor=""" + BackgroundColor + """" & Chr(13)
strCode += "//Pause marquee onMousever (0=no. 1=yes)?" & Chr(13)
strCode += "var pauseit=1" & Chr(13)
strCode += "" & Chr(13)
strCode += "//Specify the marquee's content (don't delete tag)" & Chr(13)
strCode += "//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):" & Chr(13)
strCode += "" & Chr(13)
strCode += "var marqueecontent='""" + Me.Controls.Add(xmlStockData) + Me.Controls.Add(lblError) + """'" & Chr(13)
I was able to set the Marqueebgcolor to the public property BackgroundColor.
How do I place the childcontrols inside the var marqueencontent. The last Line of the strCode produces the error
OK, I was mixing apples with Alligators. I solved my problem by using the xpathdocument class with the stringwriter class. This allowed me to convert my Transformed xsl to a string. Then I just:
Dim strHTML as stWrite.ToString()
I then placed the strHTML between the
""" + strHTML + """ of the variable marqueecontent, it worked like a charm. Thanks.
CodeJunkie
Member
267 Points
56 Posts
Javascript in composite control help needed.
Mar 09, 2004 06:15 PM|LINK
Dim strCode As String = "<script language=JavaScript>" strCode += "var marqueebgcolor=""" + BackgroundColor + """" & Chr(13) strCode += "//Pause marquee onMousever (0=no. 1=yes)?" & Chr(13) strCode += "var pauseit=1" & Chr(13) strCode += "" & Chr(13) strCode += "//Specify the marquee's content (don't delete tag)" & Chr(13)
strCode += "//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):" & Chr(13)
strCode += "" & Chr(13)
strCode += "var marqueecontent='""" + Me.Controls.Add(xmlStockData) + Me.Controls.Add(lblError) + """ '" & Chr(13)I was able to set the Marqueebgcolor to the public property BackgroundColor. How do I place the childcontrols inside the var marqueencontent. The last Line of the strCode produces the error All help is appreciated...CodeJunkie
Member
267 Points
56 Posts
Re: Javascript in composite control help needed.
Mar 10, 2004 09:53 PM|LINK