User Control Javascript problem

Last post 05-13-2008 3:47 AM by uwspstar. 2 replies.

Sort Posts:

  • User Control Javascript problem

    05-12-2008, 11:08 PM
    • Member
      point Member
    • yasir_khan
    • Member since 05-12-2008, 11:13 PM
    • Posts 13

    I have a user control with some javascript. The control is being added dynamically from the code behind.

    The javascript functions don't work after the control is added - although I can see the control. However, if I move the javascript out of the control to the containing page, everything works.

    Any ideas?

     

     

  • Re: User Control Javascript problem

    05-13-2008, 1:16 AM
    Answer
    • Member
      489 point Member
    • tapojjwal
    • Member since 08-14-2007, 9:44 AM
    • Chennai, Tamil Nadu, India
    • Posts 200

    There is direct option to add the user control in the page and then the java script might work(Not sure). For doing that you have to register the UC in your aspx page with giving the attributes src, Tagprefix and tagName....It mat help you.

    Otherwise Instead of calling the UC you write the code in a aspx file(Instead of .ascx extention) and the Load that file by using a literal control. It should work with that method.
    Please mark as Answer if the post help you to get the answer.

    Tapojjwal Mandal
  • Re: User Control Javascript problem

    05-13-2008, 3:47 AM
    Answer
    • Member
      733 point Member
    • uwspstar
    • Member since 03-23-2008, 4:36 PM
    • Milwaukee
    • Posts 210

    yasir_khan:

    I have a user control with some javascript. The control is being added dynamically from the code behind.

    The javascript functions don't work after the control is added - although I can see the control. However, if I move the javascript out of the control to the containing page, everything works.

    Any ideas?

     

     

    after you watched these 3 videos , I am sure that  you will answer your question by yourself

    http://www.asp.net/learn/videos/video-275.aspx

    http://www.asp.net/learn/videos/video-276.aspx

    http://www.asp.net/learn/videos/video-279.aspx

    founder of AskBargains.com



    If you mark as "Answer"other people can use this answer as a reference
Page 1 of 1 (3 items)