Здравствуйте, как сделать, чтобы после onclientclick срабатывал onclick?
Label labelcount = new Label();
labelcount.ID = "labelcount";
labelcount.Text = "";
Controls.Add(labelcount);
imImageMicro = ImageButton();
cbFood = new CheckBox();
cbFood.AutoPostBack = true;
cbFood.ID = "CheckBoxFood" + id;
cbFood.Text = "Food";
cbFood.Checked = false;
cbFood.CheckedChanged += cbFood_CheckedChanged;
bReheat = new Button();
bReheat.ID = "ReheatButton" + id;
bReheat.CssClass = "btn btn-info";
bReheat.Text = "Reheat";
bReheat.OnClientClick = "javascript: return countclick()";
bReheat.Click += bReheat_Click;
Controls.Add(imImageMicro);
Controls.Add(cbFood);
Controls.Add(bReheat);
protected void ScriptSet()
{
String script = "";
script += @"<script>
window.onload = function () {
var counter = 0;
var intervalHandler;
function count() {
get('labelcount').innerText = counter;
counter++;
}
function countclick() {
intervalHandler = setInterval(count, 1000);
var handler=setTimeout(function () {
clearInterval(intervalHandler);
alert('стоп');
}, 5000);
return false;
}
var get = function (id) {
return document.getElementById(id);
}
</script>
";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "CountDown", script);
}