private void Page_Load(object sender, System.EventArgs e)
{
Utility.RegisterTypeForAjax(typeof(alexa));
}
[AjaxMethod()]
public DataSet GetUrl()
{
DataSet ds = new DataSet();
string strConnection = System.Configuration.ConfigurationSettings.AppSettings["ConnStr"];
SqlConnection conn = new SqlConnection(strConnection);
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "select top 1 * from alexa order by newid()";
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);
conn.Close();
if(ds!=null)
{
return ds;
}
else
{
return null;
}
}
Web Form Designer generated code