Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I am using vs2010 in windows7 32bit.

And i have below code and it does not work at all.

What should i do?

---------------------------
ASP.NET
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>

<script type="text/vbscript">
Sub SelectItem2()
MsgBox "test vbscript.", vbInformation, "OK"
End Sub
</script>

<script type="text/javascript">
function SelectItem() {
alert("test javascript");
}
</script>
</head>
<body>
<form id="form1" runat="server">


<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="vbscript:SelectItem2()" />
<asp:Button ID="Button2" runat="server" Text="Button22" OnClientClick="SelectItem();" />


</form>
</body>
</html>
Posted
Updated 13-Feb-13 1:53am
v2
Comments
Richard MacCutchan 13-Feb-13 4:49am    
Explain what it should do and what happens when you run it.
ZurdoDev 13-Feb-13 7:55am    
What doesn't work?

1 solution

Hi,

This is working fine for me:
The script-tags:
HTML
<script type="text/vbscript" runat="server">
Sub SelectItem2()
MsgBox ("test vbscript.", vbInformation, "OK")
End Sub
</script>
 
<script type="text/javascript">
    function SelectItem() {
        alert("test javascript");
    }
</script>

The asp:Button-tags:
ASP
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="SelectItem2" />
<asp:Button ID="Button2" runat="server" Text="Button22" OnClientClick="SelectItem();" />

Hope this helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900