Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
settingtextbox.text from a listbox
Old 06-06-2005, 03:36 AM settingtextbox.text from a listbox
Junior Talker

Posts: 1
Location: Brisbane Australia
Trades: 0
Hi I am trying to set the textbox.text from a databound list box. I am using asp.net VB script.

I can get it to work if i set the listbox items manualy but not when I use a dataset.

here is the code I use to manuly do it

<%@ Page Language="vb" ContentType="text/html" ResponseEncoding="iso-8859-1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script runat="server">

Sub listbox1_SelectedIndexChanged(Sender as Object, E as EventArgs)

textbox1.Text = listbox1.SelectedValue
end sub
</script>
<html>
<head>

</head>
<p>

<form runat=server>

<asp:ListBox id=ListBox1 runat="server" Width="100px">
<asp:ListItem value="item1v">item1</asp:ListItem>
<asp:ListItem value="item2v">item2</asp:ListItem>
<asp:ListItem value="item3v">item3</asp:ListItem>
</asp:ListBox>

<p>
<asp:TextBox ID="TextBox1" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Get Value" OnClick="listbox1_SelectedIndexChanged" />
</form>

</body>
</html>
keithjakins is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to settingtextbox.text from a listbox
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13942 seconds with 12 queries