calling an ascx page method using jquery

后端 未结 8 1380
天涯浪人
天涯浪人 2020-12-01 14:16

I know that I can call a page method with jquery using the following syntax

$.ajax({
  type: \"POST\",
  url: \"Default.aspx/GetDate\",
  data: \"{}\",
  con         


        
8条回答
  •  旧巷少年郎
    2020-12-01 14:55

    No, because ascx controls don't represent a real URL that can be accessed from a client machine. They're purely server-side meant to embed in other pages.

    What you might want to do is just have an aspx page that provides the same snippet of html you currently have in your ascx file. An aspx page doesn't necessarily need to provide a full html document ( etc.), it can just render the user control you're interested in.

    We use this technique all the time with the ingrid plugin, which requires a callback url for the table contents.

提交回复
热议问题