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

Discussion in 'ASP .Net' started by Lau Lei Cheong, Oct 13, 2004.

  1. 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.

    --
    If you want to mail to me, please replace all instance of "e" to "a" in my
    email address. Thank you.
    Sorry for any inconvience caused, but there's many spam-mailers.
     
    Lau Lei Cheong, Oct 13, 2004
    #1
    1. Advertising

  2. 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......

    "Lau Lei Cheong" <> ¦b¶l¥ó
    news: ¤¤¼¶¼g...
    > 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.
    >
    > --
    > If you want to mail to me, please replace all instance of "e" to "a" in my
    > email address. Thank you.
    > Sorry for any inconvience caused, but there's many spam-mailers.
    >
    >
     
    Lau Lei Cheong, Oct 13, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Karim
    Replies:
    3
    Views:
    448
    Karim
    Nov 26, 2003
  2. =?Utf-8?B?U2lsZWVzaA==?=
    Replies:
    0
    Views:
    480
    =?Utf-8?B?U2lsZWVzaA==?=
    Nov 3, 2004
  3. Tarllem
    Replies:
    4
    Views:
    406
    Eliyahu Goldin
    Mar 6, 2005
  4. =?Utf-8?B?TWlrZSBSYW5k?=

    Adding Server Side code in a Client Side Script???

    =?Utf-8?B?TWlrZSBSYW5k?=, Jan 30, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,157
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jan 30, 2006
  5. Zoe Hart
    Replies:
    1
    Views:
    371
    Scott Wisniewski
    Jan 8, 2004
Loading...

Share This Page