Problem in adding template of server side control using client side scripts

L

Lau Lei Cheong

I have an aspx page which have the following code segment:

<script>
// I do something here
template = "<input id=\"hidden_info_1\" type=\"hidden\"
runat=\"server\">
// I do other things here
</script>

When I tried to run, it returns "Parser Error Message: The Runat attribute
must have the value Server."

Basically I want to create a server-side control with client-side
javascript. I can get rid of the error by removing the \" from the front and
back of "server", but I still want to find a way to have it double-quoted.
And actually this checking should not be inside any <script> tags,
especially when it is just a string. Any ideas?

I know I can do it at the server-side, but because the controls are supposed
to be added too frequently so that the overhead for the whole
"client-server-client" trip is just not acceptable.
 
L

Lau Lei Cheong

I found that just remove the \" won't work, it continues to complain
\"hidden_info_1\" is not a valid ID.
Now I have to move the whole thing to a seperate .js file to make it work.
Just for your information......
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top