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

Calling a Page View's JavaScript Function

3 Answers 123 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Bruce
Top achievements
Rank 1
Bruce asked on 19 May 2011, 06:31 PM

Index.aspx contains a RadtabStrip and RadMultiPage.  From Index.aspx, I am trying to call a JavaScript function found in selected PageView's content, which is another ASPX page.  My JavaScript in Index.aspx that is trying to make the call to Page VIew looks like this (saveData is the function in the child ASPX page):

 

 

 

 

var multiMain = $find("<%= mulMain.ClientID %>");

 

 

 

 

var pageToSave = multiMain.get_selectedPageView();

 

 

 

 

var pageContent = pageToSave.get_element();

 

 

pageContent.saveData()

 

;

Obviously, I can't get this to work.  I can see from the examples that you can change style information, among a number of other things, but it appears that I'm doing so for the immediate container of the child ASPX (an iframe), and not for the ASPX page itself.

Does anyone have any idea how to pull this off, how to call the JavaScript of an ASPX page contained within a Page View of RadMultiPage?

 

3 Answers, 1 is accepted

Sort by
0
Bruce
Top achievements
Rank 1
answered on 19 May 2011, 08:26 PM
I figured out a complete workaround that does just fine for my purposes.  I set the Page View's innerHTML to an iframe that I labeled that I can then find later.  With a handle on that iframe, I can call iframe.contentWindow.functionName();

I am curious if there is a standardized, accepted Telerik way of doing this.  However, if answering that question costs you any significant amount of time, please don't bother.  I have a solution that suffices.
0
Accepted
Dimitar Terziev
Telerik team
answered on 25 May 2011, 08:06 AM
Hello Bruce,

There are various sources among the web on how to achieve the desired functionality. You could check this thread for instance.

Best wishes,
Dimitar Terziev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Bruce
Top achievements
Rank 1
answered on 27 May 2011, 04:20 PM
Thanks.  That's pretty much what I did.
Tags
TabStrip
Asked by
Bruce
Top achievements
Rank 1
Answers by
Bruce
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Share this question
or