<%namespace= Microsoft. Sharepoint %>
void btn_Click(object sender, EventArgs e)
{
try
{
SPWeb web = SPContext.Current.Web;
web.AllowUnsafeUpdates = true;
web.Lists.Add("checkCustomlist", "The new custom list", SPListTemplateType.GenericList);
web.AllowUnsafeUpdates = false;
}
catch (Exception ex)
{
Context.Response.Output.Write("Error (btn_Click): " + ex.Message.ToString());
}
}