473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

<newbie> problem with updatepanel and trigger

hi

asp.net 3.5 (project upgraded from asp.net 2.0).
are using vwd2008 express now

This is my first ajax attempt. The code below shows a TextBox and a ListBox.
The idea I was trying to accomplish was that the items in the ListBox was
automatically filtered as the user type text into the textbox... But nothing
happens. The OnTextChanged event isn't even fired when I type in the
textbox.

Any suggestions?

<table style="width: 100%;">
<tr>
<td>
<asp:TextBox ID="txtTextBox1" Width="190"
OnTextChanged="OnTextChanged" runat="server"></asp:TextBox>
<asp:ImageButton ID="ImageButton1" runat="server"
ImageUrl="~/Images/Go.gif" />
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ListBox Width="200" ID="ListBox1" runat="server">
</asp:ListBox>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="txtTextBox1"
EventName="TextChanged" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
</table>
Nov 12 '08 #1
1 5311
OnTextChanged is a serverside event. it will only be fired on a
postback. you can put autopostback on a textbox to auto fire a postback,
but this will only happen when the client side onblur happens (focus
leaves textbox).

to reload the listbox as the users types will require you write client
script that is attached to the clientside onkeypress event. this code
should then do an ajax call to update the list. the update panel is
probably overkill for this, I'd just have the javascript do a webservice
call and reload the list in client script.

google combobox controls and you will get a lot of sample javascript.
the ajax control toolkit has similar control. this would probably be
covered in any javascript book.

-- bruce (sqlwork.com)
Jeff wrote:
hi

asp.net 3.5 (project upgraded from asp.net 2.0).
are using vwd2008 express now

This is my first ajax attempt. The code below shows a TextBox and a ListBox.
The idea I was trying to accomplish was that the items in the ListBox was
automatically filtered as the user type text into the textbox... But nothing
happens. The OnTextChanged event isn't even fired when I type in the
textbox.

Any suggestions?

<table style="width: 100%;">
<tr>
<td>
<asp:TextBox ID="txtTextBox1" Width="190"
OnTextChanged="OnTextChanged" runat="server"></asp:TextBox>
<asp:ImageButton ID="ImageButton1" runat="server"
ImageUrl="~/Images/Go.gif" />
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ListBox Width="200" ID="ListBox1" runat="server">
</asp:ListBox>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="txtTextBox1"
EventName="TextChanged" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
</table>

Nov 12 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

129
by: Torbjørn Pettersen | last post by:
I've started cleaning up my HTML and implementing CSS. So far I've used FrontPage, but am switching over to DreamWeaver. Reading a bit on W3Schools.com and W3.org I see there are a lot of HTML...
3
by: | last post by:
I have been researching articles on google on how to create a simple RSS feed that sucks <title><blurb><link><date> out of a sql server 2000 database via an aspx page. I know it has to be pushed...
4
by: martijn | last post by:
H!, Is it possible to get a <tag:id>value</tag:id> value ? When I do this: ----------------------------------------------------- theXML = """<?xml version="1.0"?> <title>The Fascist...
14
by: dananrg | last post by:
Been using the ODBC module for Python 2.1 (Win32) and had another question. When I return data from date columns, it's in a strange object form, e.g. <something or other> (don't have the output in...
2
by: Jeff | last post by:
hi asp.net 2.0 In a webpage I have a GridView displaying a collection of data. This collection of data is a collection of objects based on a custom class. where each object represent a record...
3
by: Jeff | last post by:
hi asp.net 2.0 i've used connectionstrings like this one for my webproject: connectionString="Server=Pdc1;Database=Testing;Integrated Security=false;User ID=tester;Pwd=hardtoguesspwd;" /> ...
0
by: Jeff | last post by:
Hi I'm following this tutorial: http://dev.live.com/gadgets/sdk/docs/default.htm And downloaded that sample file. Now I've created a simple web gadget project on my own:. I just made a copy...
4
by: Jeff | last post by:
Hi asp.net 2.0 I'm trying to implement a HyperLinkField into my GridView.. The SqlDataSource returns a field which is paths to files (each row in the GridView should have link to a file). ...
3
by: Jeff | last post by:
hi I'm wondering how to open a web browser window in VS2008. I've created a simple windows Live Agent and just want to test it in the VS2008 before I deploy it... any ideas how to open a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.