I think You are Looking For this Format..
clsInsert.cs
public class clsInsert
{
public static int actInsert(sqlInsert obj)
{
int intRes = 0;
try
{
if ("success")
{
intRes = 1;
}
else
{
intRes = 0;
}
}
catch (Exception e1)
{
intRes = -1;
}
return intRes;
}
}
public class sqlInsert
{
public string UserName { get; set; }
public string Password { get; set; }
}
Insert.aspx
protected void btnInsert_Click(object sender, EventArgs e)
{
sqlInsert clsObj = new sqlInsert();
clsObj.UserName = txtUsername.Text;
clsObj.Password = txtPassword.Text;
int intres=clsInsert.actInsert(clsObj);
if (intres == 1)
{
Response.Write("Success!");
}
else
{
Response.Write("Failed");
}
}