"i am having a textbox with datatype double"
No I am afraid that you do not. Textbox's contain strings not doubles. As Richard said, there is plenty of errors in your code. But to answer your question:
protected void btnsubmit2_Click(object sender, ImageClickEventArgs e)
{
double stotal_recpt2;
if (string.IsNullOrEmpty(txttotal_recpt2.Text)
{
stotal_rectp2 = 0;
}
}