ASP.NET WebForm???????????Ajax
???????????? ???????[ 2013/4/2 9:53:36 ] ????????
????6?????????AjaxBasePage??
???????′???
public class AjaxBasePage : System.Web.UI.Page
{
/// <summary>
/// ????????ajax????
/// </summary>
public bool IsAjaxRequest { get; private set; }
/// <summary>
/// ?????Ajax???????????????????PreInit?????????????Response
/// </summary>
protected override void OnPreInit(EventArgs e)
{
AjaxRequest ajaxRequest = AjaxRequest.GetInstance(Request.Form);
this.IsAjaxRequest = ajaxRequest.IsAjaxRequest;
if (this.IsAjaxRequest)
{
AjaxApplication ajaxApplication = new AjaxApplication(this?? ajaxRequest);
ajaxApplication.EndRequest();
}
else
{
// ???????Ajax?????????????????????????????
base.OnPreInit(e);
}
}
}
??????????д??PreInit???????ж?????????????Ajax???????AjaxRequest??????????????????????????Щ??Ч????????????????????Ajax????????????????????б??AjaxParameter????
????????AjaxParameter????????????????????????????????????????????????????????Count??????????????????????
???????′???
public class AjaxParameter
{
private IDictionary<int?? string> m_DictionaryParamsData = new Dictionary<int?? string>();
/// <summary>
/// ??????????????
/// </summary>
public int Count
{
get
{
return this.m_DictionaryParamsData.Count;
}
}
/// <summary>
/// ????????????????
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
public string this[int index]
{
get
{
if (index >= 5 || index < 0)
{
throw new NotSupportedException("???????????????????????0-5");
}
return this.m_DictionaryParamsData[index];
}
}
public AjaxParameter(IDictionary<int?? string> paramsData)
{
this.m_DictionaryParamsData = paramsData;
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11