Каждый раз, когда пользователь нажимает кнопку F5, он повторно отправляет вопрос. У меня есть код, который очищает форму, но продолжает повторно отправлять вопрос. Вот этот код:
Код: Выделить всё
protected void ResetAllControls(System.Web.UI.ControlCollection currentControls)
{
foreach (Control c in currentControls)
{
string str = c.GetType().Name;
if (c.GetType() == typeof(TextBox))
{
TextBox tb = (TextBox)c;
if (tb != null)
{
tb.Text = string.Empty;
}
}
else if (c.GetType() == typeof(DropDownList))
{
DropDownList ddl = (DropDownList)c;
ddl.SelectedIndex = -1;
}
else
{
ResetAllControls(c.Controls);
}
}
GridViewQuestionFiles.DataSource = null;
GridViewQuestionFiles.DataBind();
}
Подробнее здесь: https://stackoverflow.com/questions/792 ... ge-refresh
Мобильная версия