I'm trying the below and getting OBJECT EXPECTED error in
javascript.
On my aspx page I have this java script block:
<script language="javascript" type="text/javascript">
function SearchText(selectit)
{
document.getElementById('TextBox_Body').createText Range().find(selectit);
}
</script>
In vb.net I'm dynamically generate javascript
<script language='JavaScript'>
SearchText('car');
</script>
using this code and passing it the string "car":
Public Function SelectText(ByVal SearchString As String) As String
Return "<script language='JavaScript'>" + vbCrLf +
"SearchText('" + SearchString + "');" + vbCrLf + "</script>"
End Function
I force that block to run as follows and I understand this is not
javascript, but the problem appears to be with my rendered code. Below
is how I pass :
ClientScript.RegisterClientScriptBlock(Me.GetType, "client",
pkb.SelectText(TextBox_Search1.Text))
Thanks for any help or information.