I have one button on my page that is using the folowing code to open a new browser and web site. How can I add several other buttons that go to the same page.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Button1.Attributes.Add("onclick", "window.open( '
This works fine with one button I add another button and the folowing code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Button1.Attributes.Add("onclick", "window.open( ' Button2.Attributes.Add("onclick", "window.open( '
Now it gives the folowing error
Control 'Button2' of type 'Button' must be placed inside a form tag with runat=server.
This is the html for this page
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="employee_list.aspx.vb" Inherits="newWindowTest.employee_list"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>employee_list</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content=" name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:button id="Button1" style="Z-INDEX: 101; LEFT: 336px; POSITION: absolute; TOP: 224px" runat="server"
Text="Button"></asp:button></form>
<asp:Button id="Button2" style="Z-INDEX: 102; LEFT: 344px; POSITION: absolute; TOP: 264px" runat="server"
Text="Button"></asp:Button></form>
<form></form>
</body>
</HTML>
what am I missing
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Button1.Attributes.Add("onclick", "window.open( '
This works fine with one button I add another button and the folowing code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Button1.Attributes.Add("onclick", "window.open( ' Button2.Attributes.Add("onclick", "window.open( '
Now it gives the folowing error
Control 'Button2' of type 'Button' must be placed inside a form tag with runat=server.
This is the html for this page
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="employee_list.aspx.vb" Inherits="newWindowTest.employee_list"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>employee_list</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content=" name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:button id="Button1" style="Z-INDEX: 101; LEFT: 336px; POSITION: absolute; TOP: 224px" runat="server"
Text="Button"></asp:button></form>
<asp:Button id="Button2" style="Z-INDEX: 102; LEFT: 344px; POSITION: absolute; TOP: 264px" runat="server"
Text="Button"></asp:Button></form>
<form></form>
</body>
</HTML>
what am I missing