using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Base : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["user_id"] == null)
        {
            logout_li.Visible = false;
            create_post_li.Visible = false;
            login_li.Visible = true;
        }
        else
        {
            logout_li.Visible = true;
            create_post_li.Visible = true;
            login_li.Visible = false;
        }
    }

    protected void onBuscarClick(object sender, EventArgs e)
    {

        Response.Redirect("/index.aspx?query=" + HttpUtility.HtmlEncode(buscar_box.Text));
    }

    protected void onCerrarSesionClick(object sender, EventArgs e)
    {
        Session.Abandon();
        Response.Redirect("/index.aspx");
    }
}
