Pergunta

I'm trying to write java script at runtime in which i have to find the radiobuttonlist at runtime but i have to pass it name in string datatype

 Dim scriptText As String = ""
        scriptText &= "function DisplayCharCount(){

        scriptText &= " console.log(document.getElementById(**RadioButtonList1**));"

        scriptText &= "}"
        ClientScript.RegisterClientScriptBlock(Me.GetType(), _
            "CounterScript", scriptText, True)

RadioButtonList1 should be enter in from string like "RadioButtonList1" so how i m suppose to do that?

Foi útil?

Solução

Just use double "" or '

        Dim scriptText As String = ""
        scriptText &= "function DisplayCharCount(){"

        scriptText &= " console.log(document.getElementById('RadioButtonList1'));"

        scriptText &= "}"
        ClientScript.RegisterClientScriptBlock(Me.GetType(), _
            "CounterScript", scriptText, True)
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top