Embed ASP.NET server code in JavaScript

Posted by hotcoder on Stack Overflow See other posts from Stack Overflow or by hotcoder
Published on 2010-02-17T06:01:34Z Indexed on 2010/04/07 0:13 UTC
Read the original article Hit count: 572

Filed under:
|
|

I've embeded the following server side code within <script> tag.

<%  Dim dataTable As DataTable = cTab.getTabs(Session("UserID"))
    If (dataTable.Rows.Count > 0) Then
       For i As Int16 = 0 To dataTable.Rows.Count%>
       {
           contentEl: 'tab'+'<%dataTable.Rows(0)("TabID").ToString()%>', 
           title: '<%dataTable.Rows(0)("TabName").ToString()%>',
           closable: false,
           autoScroll: true
           },
        <% Next
    End If %>

But it is not returning the desired results due to syntax problems. How can I write it correctly?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about JavaScript