你调用的对象是空的。
protected void Page_Load(object sender, EventArgs e)
{
int Role = Convert.ToInt32(Request.QueryString["Role"].ToString());
try
{
if (Role != 3)
{
gv_ViewApplicants.Visible = true;
gv_ViewApplicants_SelectedIndexChanged(this, new EventArgs());
}
else
{
gv_ViewApplicants.Visible = false;
}
}
catch (NullReferenceException e1)
{
}
}