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

MyWebService is undefined Error

1 Answer 21 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hsuani
Top achievements
Rank 1
Hsuani asked on 26 Jul 2014, 09:17 AM
function rowSelected(sender, args) {
 
      UserID = getDataItemKeyValue(sender, args.get_gridDataItem());
 
      currentRowIndex = args.get_gridDataItem().get_element().rowIndex;
 
     $find("<%= RadTabStrip1.ClientID %>").set_selectedIndex(0);
 
     MyWebService.GetUserByUserID(UserID, setValues)
}
I tried following link:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/insert-update-delete-client/defaultcs.aspx

and made a project
I change some method name and column name about database.

I made ServiceReference :
<telerik:RadScriptManager ID="ScriptManager1" runat="server">
      <Services>
          <asp:ServiceReference Path="MyWebService.asmx" />
      </Services>
</telerik:RadScriptManager>

but I will got error in JavaScript,MyWebService is undefined

I also tried
RadScriptManager.GetCurrent(this).Services.Add(new ServiceReference(ResolveUrl("MyWebService.asmx")));

but also the same.

Could somebody help me?
I use Windows 8.1,Visual Studio 2012 Professional,SQL Server 2014.
And browser is IE 11.

1 Answer, 1 is accepted

Sort by
0
Hsuani
Top achievements
Rank 1
answered on 26 Jul 2014, 10:47 AM
I found that I need to add namespace of web service.
Tags
Grid
Asked by
Hsuani
Top achievements
Rank 1
Answers by
Hsuani
Top achievements
Rank 1
Share this question
or