I have a computer inventory search page developed by Visual Studio. On this page have a search category(dropdown list), a text box entering value, submit button for search, another button pick IP address. What I like to improve it:
When click "My IP" button, the text box get computer IP address - works now.
But also would like the dropdown list change to <asp:ListItem Value="ip">IP Address</asp:ListItem> at the same time.
Which function should I use?? onClick, or onSelect, or Javascript??
Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="search.aspx.vb" Inherits="_Default" %>
<html>
<head runat="server">
<title>Computing Equipment Inventory</title>
</head>
<body>
<form id="form1" runat="server" Defaultbutton="btnSearch" >
<div>
<H2 style="text-align: center">List Computing Equipment</H2>
<table>
<tr>
<td align="center">
</td>
<td align="right">
Type of Search:
</td>
<td align="left">
<asp
ropDownList ID="ddType" runat="server">
<asp:ListItem Value="userid">User ID</asp:ListItem>
<asp:ListItem Value="netname">Computer Name</asp:ListItem>
<asp:ListItem Value="deviceno">Device Number of equipment</asp:ListItem>
<asp:ListItem Value="ip">IP Address</asp:ListItem>
<asp:ListItem Value="mac_address">MAC Address of device</asp:ListItem>
<asp:ListItem Value="serialno">Serial Number of equipment</asp:ListItem>
</asp
ropDownList></td>
<td align="center">
</td>
</tr>
<tr>
<td align="center">
</td>
<td align="right">
Entering Data:</td>
<td align="left" valign="middle">
<asp:TextBox ID="tbData" runat="server" Width="300px"> </asp:TextBox>
<asp:Label ID="lblerror" runat="server" Visible="False" Font-
Bold="True" ForeColor="Red"></asp:Label>
</td>
</tr>
<tr>
<td align="center">
</td>
<td align="center" colspan="2">
<asp:Button ID="btnSearch" runat="server" Text="SEARCH" />
<asp:Button ID="btnClearForm" runat="server" Text="CLEAR FORM" />
<asp:Button ID="btnMyIP" runat="server" Text="My IP" /></td>
<td align="center">
</td>
</tr>
</table>
</div>
<asp:Label ID="lblIPAdress" runat="server" Visible="False"></asp:Label>
</form>
</body>
</html>
When click "My IP" button, the text box get computer IP address - works now.
But also would like the dropdown list change to <asp:ListItem Value="ip">IP Address</asp:ListItem> at the same time.
Which function should I use?? onClick, or onSelect, or Javascript??
Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="search.aspx.vb" Inherits="_Default" %>
<html>
<head runat="server">
<title>Computing Equipment Inventory</title>
</head>
<body>
<form id="form1" runat="server" Defaultbutton="btnSearch" >
<div>
<H2 style="text-align: center">List Computing Equipment</H2>
<table>
<tr>
<td align="center">
</td>
<td align="right">
Type of Search:
</td>
<td align="left">
<asp
<asp:ListItem Value="userid">User ID</asp:ListItem>
<asp:ListItem Value="netname">Computer Name</asp:ListItem>
<asp:ListItem Value="deviceno">Device Number of equipment</asp:ListItem>
<asp:ListItem Value="ip">IP Address</asp:ListItem>
<asp:ListItem Value="mac_address">MAC Address of device</asp:ListItem>
<asp:ListItem Value="serialno">Serial Number of equipment</asp:ListItem>
</asp
<td align="center">
</td>
</tr>
<tr>
<td align="center">
</td>
<td align="right">
Entering Data:</td>
<td align="left" valign="middle">
<asp:TextBox ID="tbData" runat="server" Width="300px"> </asp:TextBox>
<asp:Label ID="lblerror" runat="server" Visible="False" Font-
Bold="True" ForeColor="Red"></asp:Label>
</td>
</tr>
<tr>
<td align="center">
</td>
<td align="center" colspan="2">
<asp:Button ID="btnSearch" runat="server" Text="SEARCH" />
<asp:Button ID="btnClearForm" runat="server" Text="CLEAR FORM" />
<asp:Button ID="btnMyIP" runat="server" Text="My IP" /></td>
<td align="center">
</td>
</tr>
</table>
</div>
<asp:Label ID="lblIPAdress" runat="server" Visible="False"></asp:Label>
</form>
</body>
</html>