うまくいきませんでしたし、うまくいかないと思いますが、あなたにお願いしたかったのです(最後のチャンス)。
私は単純な ascx ファイルを持っています。(Web サービスを介して) 選択されたときにサブカテゴリを取得する 1 つの select 要素があります。他の asmx ファイルではなく、ascx.cs ファイルに Web メソッドを記述したいと考えています。
ASCX.CS ファイル
protected void public Page_Load(....){
//(because i can't give the ascx file path :)
TheAspxFileWhichContainsMyUserControl = Request.Url.LocalPath
}
[WebMethod]
static public string f_GetSubCats(int _iCatId){
return "<select><option value=1>One</option></select>";
}
ASCX ファイル:
<script type="...">
$.ajax({
url: "<%=TheAspxFileWhichContainsMyUserControl%>/f_GetSubCats",
data:...
...........
success: function(msg){
// append new select to the container
}
})
</script>