[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

javascript error in string

Hi I have the code below but I keep getting "totalUsers" is not definined

Woul be grateful for any help

  Dim strType As String = "totalUsers"
            oLiteral.Text = "<a href=""javascript: //"" id=""grid_link_" + oContainer.PageRecordIndex.ToString() + """ onclick=""getTotals(this," + strType + ")"" class=""ob_gAL_Lugaso"">" + oContainer.DataItem("TotalUsers") + "</a>"

Thanks
0
Soluga
Asked:
Soluga
1 Solution
 
Rajar AhmedConsultantCommented:
Add single quotes to the string,
Dim strType As String = "'totalUsers'"

Open in new window

0
 
SolugaAuthor Commented:
It's ok I got it

Dim strType As String = "totalUsers"
            oLiteral.Text = "<a href=""javascript: //"" id=""grid_link_" + oContainer.PageRecordIndex.ToString() + """ onclick=""getTotals(this," + "'" + strType + "'" + ")"" class=""ob_gAL_Lugaso"">" + oContainer.DataItem("TotalUsers") + "</a>"
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now