cs 返回數據庫中的某個字段,你可以構造自己的字符
[Ajax.AjaxMethod()]
public static string getDataSet()
{
SqlDataBase SqlDB=new SqlDataBase(DSN);
string strsql=String.Format(" Select * From User Where IsPower=0","User");
DataSet ds=SqlDB.CreateSet(strsql,"IU_User");
SqlDB.CloseConnection();
return ds.Tables[0].Rows[0][0].ToString();
}
client side
function getDataSet(){
WebForm1.getDataSet(GetDataSet_callback);
}
function GetDataSet_callback(response)
{
var ds = response.value; //獲取服務端的數據
alert(ds); //顯示數據
}
< INPUT style="Z-INDEX: 101; LEFT: 456px; WIDTH: 56px; POSITION: absolute; TOP: 96px; HEIGHT: 24px" type="button" value="test" onclick="getDataSet();">