locked
Client side Ajax RRS feed

  • Question

  • User-421263156 posted

    Hi,

    I am having a user control which contains a few controls from Ajax toolkit. I want to use this control to be downloaded using client side ajax. I am able to download the same. However, the scripts associated with these controls (ajax toolkit ones) are not working on the page.

    Pls help

    Regards

    Raghav

    Wednesday, November 5, 2008 3:45 AM

Answers

  • User-1597315603 posted
    Hi Raj_TheKing<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
    <o:p> </o:p>
    I have read the thread carefully; however, I am not sure what the “control to be downloaded using client side ajax” means, based on my understanding, you need to create the control by client-side script, right?
    <o:p> </o:p>
    If so, you can check the following link to see the related FAQ:
    <o:p> </o:p>
    13. Dynamically creating controls<o:p></o:p>
    http://forums.asp.net/thread/1293293.aspx#13
    <o:p> </o:p>

    Thanks.


     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, November 9, 2008 10:09 PM
  • User-1597315603 posted
    Yes, in this scenario, the JavaScript cannot load into the DIV dynamically by set the innerHTML, if you need to register JavaScript dynamically at runtime, I would like to suggest you try to use ClientScriptManager.RegisterClientScriptInclude or ClientScriptManager.RegisterStartupScript.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
    <o:p> </o:p>
    The following article is also a very good article talks about how to load JavaScript dynamically by AJAX:<o:p></o:p>
    <o:p> </o:p>
    Howto Dynamically Insert Javascript And CSS<o:p></o:p>
    http://www.hunlock.com/blogs/Howto_Dynamically_Insert_Javascript_And_CSS<o:p></o:p>
    <o:p> </o:p>
    Thanks.<o:p></o:p>

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 10, 2008 1:52 AM

All replies

  • User-1597315603 posted
    Hi Raj_TheKing<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
    <o:p> </o:p>
    I have read the thread carefully; however, I am not sure what the “control to be downloaded using client side ajax” means, based on my understanding, you need to create the control by client-side script, right?
    <o:p> </o:p>
    If so, you can check the following link to see the related FAQ:
    <o:p> </o:p>
    13. Dynamically creating controls<o:p></o:p>
    http://forums.asp.net/thread/1293293.aspx#13
    <o:p> </o:p>

    Thanks.


     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, November 9, 2008 10:09 PM
  • User-421263156 posted

     

    Hi,

    Thanks for the reply. I will explain in detail. I have a button on the web form and on click of it, i would like to download the contents of a user control into a div tag. This is being currently done using client side ajaxing. I am able to get all data using web services and put the same into the div tag. The data output is string, and i can put the string in the innerHTML part of the div tag.

    However, my challenge starts here. Everything works fine except javascript tags and functions defined in the user control. I am unable to use these javascript functions in my web form. The javascript is not being recognised.

    Need help on this

    Regards

    Raj

    Monday, November 10, 2008 1:34 AM
  • User-1597315603 posted
    Yes, in this scenario, the JavaScript cannot load into the DIV dynamically by set the innerHTML, if you need to register JavaScript dynamically at runtime, I would like to suggest you try to use ClientScriptManager.RegisterClientScriptInclude or ClientScriptManager.RegisterStartupScript.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
    <o:p> </o:p>
    The following article is also a very good article talks about how to load JavaScript dynamically by AJAX:<o:p></o:p>
    <o:p> </o:p>
    Howto Dynamically Insert Javascript And CSS<o:p></o:p>
    http://www.hunlock.com/blogs/Howto_Dynamically_Insert_Javascript_And_CSS<o:p></o:p>
    <o:p> </o:p>
    Thanks.<o:p></o:p>

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 10, 2008 1:52 AM
  • User-421263156 posted

    Thanks, this solved the problem
    Wednesday, November 12, 2008 11:47 PM