The basic question was: " How do I get the choice/selection of a dropdowndown list to be a variable, to be used for the rest of the process/program?"
I found what I thought was the answer, but instead got this error. I've several different declarations, none worked.
If someone could point me in the right direction, it would be most appreciated.
I've done some programming, but .ASP is new to me.
Thanx
N.
On to the Story
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
Source Error:
Line 20:
Line 21:
Line 22: Protected Sub FormView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewPageEventArgs) Handles FormView1.PageIndexChanging
Line 23:
Line 24: End Sub
Source File: C:\Documents and Settings\WiFi\My Documents\Visual Studio 2005\WebSites\WebSite1\Default.aspx.vb Line: 22
The code that caused this mess:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<script runat="server">
Sub submit(ByVal sender As Object, ByVal e As EventArgs)
mess.Text = "You selected TruckList.SelectedItem.Value" & TruckList.SelectedItem.Value
mess1.Text = "Hello from the inside of TruckList.DataValueField" & TruckList.DataValueField
mess2.Text = "Hello from the inside of TruckList.SelectedValue" & TruckList.SelectedValue
mess3.Text = "Hello from the inside of TruckList.SelectedIndex" & TruckList.SelectedIndex
End Sub
</script>
<html xmlns=" >
<head runat="server">
<title>Whitlock WIFI Development Crop.</title>
</head>
<! Dim WithEvents submit As New Button !>
<body>
<form id="form1" runat="server">
<div id="DIV1">
Pick ATruck to Monitor
<aspropDownList ID="TruckList" runat="server">
<asp:ListItem Value="190.180.170.101">Truck1</asp:ListItem>
<asp:ListItem Value="190.180.170.102">Truck2</asp:ListItem>
<asp:ListItem Value="190.180.170.103">Truck3</asp:ListItem>
<asp:ListItem Value="190.180.170.104">Truck4</asp:ListItem>
<asp:ListItem Value="190.180.170.105">Truck5</asp:ListItem>
<asp:ListItem Value="190.180.170.106">Truck6</asp:ListItem>
<asp:ListItem Value="190.180.170.107">Truck7</asp:ListItem>
<asp:ListItem Value="190.180.170.108">Truck8</asp:ListItem>
<asp:ListItem Value="190.180.170.109">Truck9</asp:ListItem>
<asp:ListItem Value="190.180.170.110">Truck10</asp:ListItem>
</aspropDownList><br />
<br />
<asp:Button Text="Submit" OnClick="submit" runat="server"/>
<p><asp:label id="mess" runat="server"/></p>
<p><asp:label id="mess1" runat="server"/></p>
<p><asp:label id="mess2" runat="server"/></p>
<p><asp:label id="mess3" runat="server"/></p>
Hello from the inside of <br />
</div>
</form>
</body>
</html>
I found what I thought was the answer, but instead got this error. I've several different declarations, none worked.
If someone could point me in the right direction, it would be most appreciated.
I've done some programming, but .ASP is new to me.
Thanx
N.
On to the Story
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
Source Error:
Line 20:
Line 21:
Line 22: Protected Sub FormView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewPageEventArgs) Handles FormView1.PageIndexChanging
Line 23:
Line 24: End Sub
Source File: C:\Documents and Settings\WiFi\My Documents\Visual Studio 2005\WebSites\WebSite1\Default.aspx.vb Line: 22
The code that caused this mess:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<script runat="server">
Sub submit(ByVal sender As Object, ByVal e As EventArgs)
mess.Text = "You selected TruckList.SelectedItem.Value" & TruckList.SelectedItem.Value
mess1.Text = "Hello from the inside of TruckList.DataValueField" & TruckList.DataValueField
mess2.Text = "Hello from the inside of TruckList.SelectedValue" & TruckList.SelectedValue
mess3.Text = "Hello from the inside of TruckList.SelectedIndex" & TruckList.SelectedIndex
End Sub
</script>
<html xmlns=" >
<head runat="server">
<title>Whitlock WIFI Development Crop.</title>
</head>
<! Dim WithEvents submit As New Button !>
<body>
<form id="form1" runat="server">
<div id="DIV1">
Pick ATruck to Monitor
<aspropDownList ID="TruckList" runat="server">
<asp:ListItem Value="190.180.170.101">Truck1</asp:ListItem>
<asp:ListItem Value="190.180.170.102">Truck2</asp:ListItem>
<asp:ListItem Value="190.180.170.103">Truck3</asp:ListItem>
<asp:ListItem Value="190.180.170.104">Truck4</asp:ListItem>
<asp:ListItem Value="190.180.170.105">Truck5</asp:ListItem>
<asp:ListItem Value="190.180.170.106">Truck6</asp:ListItem>
<asp:ListItem Value="190.180.170.107">Truck7</asp:ListItem>
<asp:ListItem Value="190.180.170.108">Truck8</asp:ListItem>
<asp:ListItem Value="190.180.170.109">Truck9</asp:ListItem>
<asp:ListItem Value="190.180.170.110">Truck10</asp:ListItem>
</aspropDownList><br />
<br />
<asp:Button Text="Submit" OnClick="submit" runat="server"/>
<p><asp:label id="mess" runat="server"/></p>
<p><asp:label id="mess1" runat="server"/></p>
<p><asp:label id="mess2" runat="server"/></p>
<p><asp:label id="mess3" runat="server"/></p>
Hello from the inside of <br />
</div>
</form>
</body>
</html>