I need to do btnRate_Click after particular time on javascript/jquery
protected void btnRate_Click(object sender, EventArgs e)
{
if (Session["User"] != null && Session["ActiveDoctor"] != null)
{
if (objRate.InsertRecord())
Response.Redirect("../Clinics.aspx", true);
}
}
Please help….
Assuming there’s a button which has a click event which is tied to btnRate_Click, you can use __doPostback to trigger the post back.
This means you could do something like:
window.setTimeout(function() { __doPostback('<%= btnRate.UniqueID %>', '');}, 1000);This should ‘click’ btnRate 1 second after calling the code.
See the following question for more info on __doPostback:
How to use __doPostBack()