473,394 Members | 1,722 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,394 software developers and data experts.

fire an event without postback?

I am building a control which has some buttons and when
you click a button it moves information from one listbox
to another. this control could be near the bottom of a web
page, so I cannot have the page reloading every time
someone clicks one of the buttons. How can I fire their
events without posting back to the server? Here is an
example of what I mean..

http://www.metabuilders.com/Tools/DualList.aspx
the smack button posts back to the server, but the others
do not.. as near as I can tell no javascript is used..
Nov 17 '05 #1
2 2826

"Will" <ws*****@comcast.net> wrote in message
news:06****************************@phx.gbl...
I am building a control which has some buttons and when
you click a button it moves information from one listbox
to another. this control could be near the bottom of a web
page, so I cannot have the page reloading every time
someone clicks one of the buttons. How can I fire their
events without posting back to the server? Here is an
example of what I mean..

http://www.metabuilders.com/Tools/DualList.aspx
the smack button posts back to the server, but the others
do not.. as near as I can tell no javascript is used..


I didn't look too closely at the ViewSource of the page but it looks like
it's all client-side code. Sure the "Add ->" button is a "submit" button
but the author's also got an onsubmit attribute on his/her <form> tag. So,
there's probably code running to check if a postback is needed when the form
submits on the client.
Nov 17 '05 #2
Hi

Sure there is Javascript if done on the client
Example
<html>
<head>
<script>
function moveSelItems(f){
f.sel2.options.length = 0;
var e;
for(i=0;i<f.sel1.options.length;i++)
{
e = document.createElement("option");
e.value = f.sel1.options[i].value;
e.text = f.sel1.options[i].text;
f.sel2.options.add(e);
}
}
</script>
</head>
<body>
<form>
<select name="sel1">
<option value="1">v1</option>
<option value="2">v2</option>
<option value="3">v3</option>
</select> <input type="button" onclick="moveSelItems(this.form)"
value="Click to add"><br>
<select name="sel2"></select>
</form>
</body>
</html>

--
Best Regards
Vidar Petursson
==============================
Microsoft Scripting MVP
http://www.microsoft.com/technet/scriptcenter
==============================
"Will" <ws*****@comcast.net> wrote in message
news:06****************************@phx.gbl...
I am building a control which has some buttons and when
you click a button it moves information from one listbox
to another. this control could be near the bottom of a web
page, so I cannot have the page reloading every time
someone clicks one of the buttons. How can I fire their
events without posting back to the server? Here is an
example of what I mean..

http://www.metabuilders.com/Tools/DualList.aspx
the smack button posts back to the server, but the others
do not.. as near as I can tell no javascript is used..

Nov 17 '05 #3

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

Similar topics

1
by: Duwayne | last post by:
I am having a lot of trouble with an ascx page that has a textbox that *should fire a textchange event when the text changes. The main aspx page dynamically loads the ascx page and has a image...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
5
by: Verde | last post by:
This is admittedly an apparently odd request... but please indulge me if you don't mind: Suppose I have two <asp:Button.../> on a page (Button1 and Button2). User clicks Button1 and triggers a...
2
by: Stuart Whiteford | last post by:
Hi, I asked this back in January without answer and forgot about it until now. I've got a basic web form, two textboxes, a couple of radio button groups, some required field validators, and a...
3
by: Beavis | last post by:
I hate to repost a message, but I am still at the same point where I was when I originally posted, and hopefully someone else will see this one... Ok, so I have gone off and documented the...
3
by: rfinch | last post by:
I'm trying to pass two values from client script (Javascript) to the code-behind for a page using three hidden fields - two to hold the values and a third to fire the ValueChanged event. I have...
19
by: Daniela Roman | last post by:
Hello, I try to fire an event under a button click event and maybe anybody can give a clue please. I have let's say a WEB grid with PageIndexChanged event: private void...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
1
by: John Dalberg | last post by:
What causes a server event to fire when something happens on the client? Say a user changed the gridview's page index, the server side PageIndexChanged event is fires. What makes...
3
by: | last post by:
Hi all, I have a CheckBoxList control which has about 10 items. I have set autopostback=true and also set an eventhandler for OnSelectedIndexChanged. The problem is I want to identify which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.