ajax 小节
Ajax.Utility.RegisterTypeForAjax(typeof(sp))
插入 page_load 中
[Ajax.AjaxMethod()]
public int addvideoplaylist(string id,string PARTY_ID)
{
int b=0;
if(!"".Equals(PARTY_ID) && !"".Equals(id))
{
string sqlstr =string.Format("insert into mycollection(videoid,PARTY_ID) values({0},'{1}')",id,PARTY_ID);
sql.MycollectionSqls.addMyCollection(sqlstr);
string message="视频添加成功!";
Page.Response.Write("<script>alert('"+message+"')</"+"scrip>");
}
else
{
b=1;
}
return b;
}
返回的值是一个对象,要用 .value 来获得值
插入 page_load 中
[Ajax.AjaxMethod()]
public int addvideoplaylist(string id,string PARTY_ID)
{
int b=0;
if(!"".Equals(PARTY_ID) && !"".Equals(id))
{
string sqlstr =string.Format("insert into mycollection(videoid,PARTY_ID) values({0},'{1}')",id,PARTY_ID);
sql.MycollectionSqls.addMyCollection(sqlstr);
string message="视频添加成功!";
Page.Response.Write("<script>alert('"+message+"')</"+"scrip>");
}
else
{
b=1;
}
return b;
}
返回的值是一个对象,要用 .value 来获得值