0

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?

1 Answer 1

1

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)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.