<script type="text/javascript">
document.onkeyup = KeyCheck;
function KeyCheck(e) {
var KeyID = (window.event) ? event.keyCode : e.keyCode; switch (KeyID) {
case 118:
__doPostBack('__Page', 'F7');
break;
case 39:
//__doPostBack('__Page', 'ArrowRight');
__doPostBack('Button2', '')
break;
case 40:
__doPostBack('__Page', 'ArrowDown'); break;
}
}
</script>
function KeyCheck(e) {
var KeyID = (window.event) ? event.keyCode : e.keyCode; switch (KeyID) {
case 118:
__doPostBack('__Page', 'F7');
break;
case 39:
//__doPostBack('__Page', 'ArrowRight');
__doPostBack('Button2', '')
break;
case 40:
__doPostBack('__Page', 'ArrowDown'); break;
}
}
</script>
<form id="form1" runat="server">
<a id="LButton3" href="javascript:__doPostBack('Button2','')">LinkButton</a>
<a id="A1" href="DisableBackButton.aspx">LinkButton</a>
<asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Button" />
</form>
<a id="LButton3" href="javascript:__doPostBack('Button2','')">LinkButton</a>
<a id="A1" href="DisableBackButton.aspx">LinkButton</a>
<asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Button" />
</form>
Server Side Code
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(DateTime.Now.ToString());
Page.ClientScript.GetPostBackEventReference(this, "");
string eventArgs = Request["__EVENTARGUMENT"]; if (!string.IsNullOrEmpty(eventArgs))
{
switch (eventArgs)
{
case "F7":
a("F7");
break;
}
}
}
{
Response.Write(DateTime.Now.ToString());
Page.ClientScript.GetPostBackEventReference(this, "");
string eventArgs = Request["__EVENTARGUMENT"]; if (!string.IsNullOrEmpty(eventArgs))
{
switch (eventArgs)
{
case "F7":
a("F7");
break;
}
}
}
public void a(string s)
{
Response.Write(s);
}
{
Response.Write(s);
}
No comments:
Post a Comment