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

How to get file path from the server side

1 Answer 155 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Shaza
Top achievements
Rank 1
Shaza asked on 01 Aug 2011, 10:09 AM
Hey,
I'm working on fileExplorer and I need to do the following scenario:
- When the user clicks on the file/folder => the path of the file/folder should be posted to the server side.
I've tried to invoke server side method from onClientSide event using PageMethods, but that didn't work !!
Can you help me?

Here's the code using PageMethods:
JavaScript
  
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server" EnablePageMethods="true">
 </telerik:RadScriptManager>
 <telerik:RadFileExplorer ID=
"RadFileExplorer1" runat="server" Skin="WebBlue"   onitemcommand="RadFileExplorer1_ItemCommand" OnClientItemSelected="GetMessage()">


<script type="text/javascript">
 
function OnGetMessageSuccess(result, userContext, methodName) {
        alert(result);<br>    }
 
function OnGetMessageFailure(error, userContext, methodName) {
     alert(error.get_message());  }
   
function GetMessage(sender, args) {     
   PageMethods.Message();}
</script>

CS
 
     [System.Web.Services.WebMethod]
      
public static void Message()
     { label1.Text =
"YES!";<br>        }

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 03 Aug 2011, 03:23 PM
Hi Shaza,

I believe the following KB article will be of help solving this case:
Pass all of the selected items' paths to the server

All the best,
Dobromir
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.

Tags
FileExplorer
Asked by
Shaza
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or