473,804 Members | 2,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2158
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.googl e.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******* *******@TK2MSFT NGP11.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.googl e.com...
"Rajesh.V" <Ra***********@ hotmail.com> wrote in message news:<OZ******* *******@TK2MSFT NGP11.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
32843
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
2856
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 expire in 5 minutes like so. If Not IsPostBack Then BindMyDropDown() Else Response.Write("<hr>Cache Expires 5 minutes" &
0
1005
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 bottom bar of VS .NET. Is there some way of speeding up this project opening?
0
1114
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 Username must be unique, obviously, and this is enforced at database level, with a unique index on username field. I use a BO object to save / load data from database. This BO uses a DataRow
8
5882
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 get in to the equation (?)
5
2083
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 is a long delay before hitting breakpoint in page load. When I initially load the page I hit the breakpoint right away. Then I click on a Sort header in a datagrid, and it takes about 1:45 before the breakpoint (first statement in Page Load) is...
2
1747
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 anything on a control based level. I know that if we place these 3 strings in aspx header then we can kill the most of the caches beginning from the server and down to the client machine. <META http-equiv="Pragma" content="NO-CACHE"> <META...
1
1964
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 fetches some information about that user and stored it in the session, then in the postback it uses that information from the session. However, if the user has the IE browser cache setting at the default
4
1716
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 till all the listboxes and dropdown selections are made then the data is postback to server when the submit button is clicked? Thanks for any response in advance!
0
9714
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10599
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10090
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9173
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7635
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5531
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.