This is a migrated thread and some comments may be shown as answers.

Unable to get js to work properly inside RadPageView

1 Answer 65 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jerald
Top achievements
Rank 1
Jerald asked on 20 Feb 2017, 04:48 AM

I have the following RadPageView in my WebForms application:

<telerik:RadPageView ID="rpvInspsSketch" runat="server">
     
     <div class="fs-container">
          <div id="lc"></div>
     </div>
 
     <script src="../_js_libs/react-0.14.3.js"></script>
     <script src="../_js_libs/literallycanvas.js"></script>
                         
     <script type="text/javascript">
          var lc = LC.init(document.getElementById("lc"), {
          imageURLPrefix: '../_assets/lc-images',
          toolbarPosition: 'bottom',
          defaultStrokeWidth: 2,
          strokeWidths: [1, 2, 3, 5, 30]
          });
     </script>
 
</telerik:RadPageView>

 

The canvas displays properly, but none of the drawing tools work.  If I move the code outside the RadPageView it works as expected. 

How can I get this to work inside the RadPageView?

Thanks - Jerald

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 22 Feb 2017, 09:23 AM

Hello Jerald,

I am not sure how this script is loaded and what is the component that fails to initialize, but at this point my best guess is that the issue is that this PageView is loaded in the browser with AJAX, so inline scripts are not parsed. You can register them from the server code via the ScriptManger static methods (RegisterStartupScript, RegisterClientScriptBlock and RegisterClientScriptInclude). Once the third party tool works properly with AJAX, it should work with the PageView as well.

Regards,

Marin Bratanov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Jerald
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or