Using jQuery AJAX to call ASP.NET function in control code-behind instead of page code-behind

后端 未结 2 1781
余生分开走
余生分开走 2020-12-19 15:55

I have a user control that I\'m creating that is using some AJAX in jQuery.

I need to call a function in the code-behind of my control, but every example I find onli

2条回答
  •  醉话见心
    2020-12-19 16:30

    You can't...WebMethods have to be in WebServices or Pages, they cannot be inside UserControls.

    Think about it a different way to see the issue a bit clearer...what's the URL to a UserControl? Since there's no way to access them you can't get at the method directly. You could try another way perhaps, maybe a proxy method in your page?

提交回复
热议问题