1
private void SetClientScriptBlock()
2
{
3
string scriptName = "CustView";
4
string script = @"<script language=JavaScript type='text/javascript'>
5
function ShowCust(x)
6
{
7
var sql;
8
if (x.id == '" + txtLookFor.ClientID + @"')
9
{
10
// cancel the default behavior of server control or HTML submit button
11
// by cancel event bubbling and returning false
12
window.event.returnValue = false;
13
window.event.cancelBubble = true;
14
15
window.location.href='VIE_Default.aspx?act=list&al=' + x.value;
16
}
17
}
18
function CheckKeyReturn(x)
19
{
20
var keyCode = event.keyCode ? event.keyCode :
21
event.which ? event.which : event.charCode;
22
if (keyCode == 13)
23
{
24
ShowCust(x);
25
}
26
else
27
{
28
return true;
29
}
30
}
31
</script>";
32![]()
33
if (!(Page.ClientScript.IsClientScriptBlockRegistered(scriptName)))
34
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), scriptName, script.ToString());
35
}
private void SetClientScriptBlock()2
{3
string scriptName = "CustView";4
string script = @"<script language=JavaScript type='text/javascript'>5
function ShowCust(x)6
{7
var sql;8
if (x.id == '" + txtLookFor.ClientID + @"')9
{10
// cancel the default behavior of server control or HTML submit button11
// by cancel event bubbling and returning false12
window.event.returnValue = false;13
window.event.cancelBubble = true;14
15
window.location.href='VIE_Default.aspx?act=list&al=' + x.value;16
}17
}18
function CheckKeyReturn(x)19
{20
var keyCode = event.keyCode ? event.keyCode :21
event.which ? event.which : event.charCode;22
if (keyCode == 13)23
{24
ShowCust(x);25
}26
else27
{28
return true;29
}30
}31
</script>";32

33
if (!(Page.ClientScript.IsClientScriptBlockRegistered(scriptName)))34
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), scriptName, script.ToString());35
}

浙公网安备 33010602011771号