Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing ASP.NET WebService with javascript
    primarykey
    data
    text
    <p>I have this code in my project:</p> <pre><code>var UI = { Layouts: { ShowLayoutSettings: function(pid, lid) { My.PageServices.GetPageLayout(lid, pid, UI.Layouts._onShowLayoutSettings); }, _onShowLayoutSettings: function(obj) { alert(obj.ID); } } } </code></pre> <p>and in my asp.net project a web service named PageServices:</p> <pre><code>namespace My { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] [System.Web.Script.Services.ScriptService] public class PageServices : System.Web.Services.WebService { public PageServices() { } [WebMethod] [ScriptMethod(UseHttpGet = false, XmlSerializeString = true)] [GenerateScriptType(typeof(PageLayout))] public PageLayout GetPageLayout(string lid, int pid) { if (!SystemModel.UserManager.HasLogin()) return null; var o = SystemModel.Layouts.GetPageLayout(pid); o.Tag = lid; return o; } } } </code></pre> <p>I should mention that my PageLayout class is a linq class and it's serialization mode is Unidirectional.</p> <p>and finally a anchor link:</p> <pre><code>&lt;a href="#" onclick="UI.Layouts.ShowLayoutSettings(5,2);"&gt;Test&lt;/a&gt; </code></pre> <p>My problem is it is correct and sends ajax request to my service when I click this link and my service returns the object as needed, but it does not fire _onShowLayoutSettings as the call back function for this request.</p> <p>I tested this work when I create a web servive which just returns and String object, and it was all correct, but I don't know why for my PageLayout object, it's not correct.</p> <p>Please help me. Thank you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload