jianxin9
asked on
Combining two page load statements?
Is there a way to combine these two page statements into one? Â Thanks!
private void Page_Load(object sender, EventArgs e)
{
statusCheckName.Attributes.Add("onclick", "showHide();");
Page.ClientScript.RegisterStartupScript(this.GetType(), "OnLoadHandler", "showHide();", true);
}
void Page_Load()
{
if (Page.IsPostBack)
{
questionsPanel.Visible = false;
Message.Visible = true;
int correct = 0;
if (q1.SelectedIndex == 2) correct++;
if (q2.SelectedIndex == 4) correct++;
if (q3.SelectedIndex == 2) correct++;
if (q4.SelectedIndex == 0) correct++;
if (q5.SelectedIndex == 5) correct++;
if (q6.SelectedIndex == 1) correct++;
if (q7.SelectedIndex == 2) correct++;
LoadConn(correct);
}
else
{
questionsPanel.Visible = true;
Message.Visible = false;
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
THANK YOU!
ASKER