can you add a breakpoint inside Button_say_Click and to see if it ever get executed?actually, since you have 
Button_say.Attributes["onclick"]="sendTo()";the client side is executed first, so Button_say_Click is never executed, try
private void Page_Load(object sender, System.EventArgs e)
{
Random rd=new Random();
i=rd.Next(1,1000);
string isframe = "" + Request["frame"];
if (isframe != "")
{
main_panel.Visible=true;
iframe_panel.Visible=false;
}
}
…………
private void Button_say_Click(object sender, System.EventArgs e)
{
Conn.ConnClass conn=new Conn.ConnClass();
conn.NonQuery("insert into gbook (name,say) values ('"+TextBox_name.Text+"','"+TextBox_say.Text+"')");
                            Page.RegisterStartupScript("Startup","<script language=JavaScript>sendTo();</" + "script>");
}