Click here to Skip to main content
11,927,156 members (57,210 online)
Rate this:
Please Sign up or sign in to vote.
See more: VBScript

I am using vs2010 in windows7 32bit.

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

What should i do?

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
<script type="text/vbscript">
Sub SelectItem2()
MsgBox "test vbscript.", vbInformation, "OK"
End Sub
Posted 12-Feb-13 22:40pm
Edited 13-Feb-13 2:53am
Maciej Los210.1K
Richard MacCutchan 13-Feb-13 4:49am
Explain what it should do and what happens when you run it.
ryanb31 13-Feb-13 7:55am
What doesn't work?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


This is working fine for me:
The script-tags:
<script type="text/vbscript" runat="server">
Sub SelectItem2()
MsgBox ("test vbscript.", vbInformation, "OK")
End Sub
<script type="text/javascript">
    function SelectItem() {
        alert("test javascript");
The asp:Button-tags:
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="SelectItem2" />
<asp:Button ID="Button2" runat="server" Text="Button22" OnClientClick="SelectItem();" />
Hope this helps.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100