You have not declared a type for
message
, but even if you did, it will only exist inside your
if
block. You need to declare it at the top of the event block like:
protected void btnsubmit_Click(object sender, EventArgs e)
{
string message = "";
if (txtpwd.Text == txtcnmpwd.Text)
{