string script = @" function clickButton(e, buttonid) { var bt = document.getElementById(buttonid); if (typeof bt == 'object') { if (navigator.appName.indexOf('Microsoft Internet Explorer')>(-1)){ if (event.keyCode == 13){ bt.click(); return false; } } else { if (e.keyCode == 13) { bt.click(); return false; } } } } "; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "search", script, true); if (this.Request["tab"] == null || this.Request["tab"] == "All Resources") { this.txtGeneralSearch.Attributes.Add("onkeypress", "return clickButton(event,'" + this.btnSearch.ClientID + "')"); }
No comments:
Post a Comment