Click button change dropdown value?

Joined
Nov 19, 2009
Messages
1
Reaction score
0
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:DropDownList 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:DropDownList></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>&nbsp;
<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" />&nbsp;
<asp:Button ID="btnClearForm" runat="server" Text="CLEAR FORM" />&nbsp;
<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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top