473,405 Members | 2,160 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,405 software developers and data experts.

cache or delay postback?

Hello,

Ive placed a server control button on my aspx page. Ive created some
client side script that Ive tied to the onclick action of this button.
The script adds to a listbox the contents of a textbox. It works
very well, but the page does a postback, and the listbox resets
itself.

The listbox has to be a server control, so I cant create this whole
scenario using your basic client side javascript.
How can I stop the postback...or cache it for later...or in some way
keep the page from reloading? Can I build an html button and tie the
server listbox control to it?

Any ideas would be appreciated.

Thank!
B. Rubble
Nov 17 '05 #1
3 2142
Add return false; after your js tied to onClick. This should arrest the
postback. If you want the added items to persist then the same shud be added
to a hidden text box and added to the list whenever the postback happens.

"Rubble" <ra****@hotmail.com> wrote in message
news:8a************************@posting.google.com ...
Hello,

Ive placed a server control button on my aspx page. Ive created some
client side script that Ive tied to the onclick action of this button.
The script adds to a listbox the contents of a textbox. It works
very well, but the page does a postback, and the listbox resets
itself.

The listbox has to be a server control, so I cant create this whole
scenario using your basic client side javascript.
How can I stop the postback...or cache it for later...or in some way
keep the page from reloading? Can I build an html button and tie the
server listbox control to it?

Any ideas would be appreciated.

Thank!
B. Rubble

Nov 17 '05 #2
"Rajesh.V" <Ra***********@hotmail.com> wrote in message news:<OZ**************@TK2MSFTNGP11.phx.gbl>...
Add return false; after your js tied to onClick. This should arrest the
postback. If you want the added items to persist then the same shud be added
to a hidden text box and added to the list whenever the postback happens.


That sounds easy enough! Thanks for the suggestion, Ill try it out
later. I thought that it would have to be some asp.net setting since
a server button control would always post back to the server, no
matter what the action was it performed.

On a similar note...can anyone show me how to get values from an html
control on the code behind? If I place the values in a hidden text
box, Ill have to pull them when I process the page. I know how to do
this in old asp...but how do I do it in asp.net?

thanks again!
Nov 17 '05 #3
After u place the htmlcontrol, right click and choose run as server control.
Then you can access the same in code behind.

"Rubble" <ra****@hotmail.com> wrote in message
news:8a************************@posting.google.com ...
"Rajesh.V" <Ra***********@hotmail.com> wrote in message news:<OZ**************@TK2MSFTNGP11.phx.gbl>...
Add return false; after your js tied to onClick. This should arrest the
postback. If you want the added items to persist then the same shud be added to a hidden text box and added to the list whenever the postback

happens.
That sounds easy enough! Thanks for the suggestion, Ill try it out
later. I thought that it would have to be some asp.net setting since
a server button control would always post back to the server, no
matter what the action was it performed.

On a similar note...can anyone show me how to get values from an html
control on the code behind? If I place the values in a hidden text
box, Ill have to pull them when I process the page. I know how to do
this in old asp...but how do I do it in asp.net?

thanks again!

Nov 17 '05 #4

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

Similar topics

3
by: Bite My Bubbles | last post by:
I found the answer! It is a IIS 6 /ASP problem http://support.microsoft.com/default.aspx?scid=kb;en-us;332075
3
by: martin | last post by:
Hi, I am storing a dataset in cache, which is happening fine. I can easily retrive it at postback from the cache, cast it to a dataset and reuse it. However I have specified that the cache...
0
by: mg | last post by:
When I'm connected to a remote network via a VPN connection and open a WebForm project, I experience a considerable delay. During this delay, an "Initializing offline cache" message appears in the...
0
by: NWx | last post by:
Hi, I discovered a strange (?!?!) issue related objects saved to cache. Let's explain my situation. I have a webform for user registration. Users enter username, password and other info...
8
by: Jason Shohet | last post by:
Lets say I want a button to execute 10 seconds after I press it, not immediately. Any ideas how to cause that, in a code-behind. IMO its only server side code, I don't think javascript needs to...
5
by: DCC-700 | last post by:
I am using ASP.Net with VB on the 1.1 Framework running on Win XP Pro. I am trying to gauge the time it takes to sort a datagrid using different code sets. But when I am debugging the page there...
2
by: Just D. | last post by:
All, Can we enable/disable the cache for each control separately or it's a global feature for the whole page? I'm aware of many settings and some bugs regarding cache but I've never seen...
1
by: ajfish | last post by:
Hi, In my asp.net 1.1 web application there is a page with a url something like userinfo.aspx?userid=107 which has some postback buttons on it. In the GET method (i.e. IsPostBack = false) it...
4
by: =?Utf-8?B?RGFpc3k=?= | last post by:
I have a couple of listboxes and dropdownlist on a page and they are postback enabled. The problem is whenever user clicks the box the page brings to the top. is there anyway to delay the postback...
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: 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?
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
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
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
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.