473,666 Members | 2,237 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using callback, I fill dorpdownlist without postback but it gets empty when a postback is executed

Hi all!

In a my simple project I use callback to fill a dropdownlist with xml data
returned by a web service, based on a value which is input via another
dropdownlist.

NOTE: I can't use ajax/atlas.

Using javascript and callback all works... but if I press a button or any
event that raise a postback, the dropdownlist that I fill gets empty!

This also if I set its EnableViewstate property to false.

Someone can help me?

Thank you and regards
F.

Jan 19 '08 #1
2 1832
Is Button a HTML Submit Button or a normal HTML Button. ?

Regards
JIGNESH

"Fabio Mastria" wrote:
Hi all!

In a my simple project I use callback to fill a dropdownlist with xml data
returned by a web service, based on a value which is input via another
dropdownlist.

NOTE: I can't use ajax/atlas.

Using javascript and callback all works... but if I press a button or any
event that raise a postback, the dropdownlist that I fill gets empty!

This also if I set its EnableViewstate property to false.

Someone can help me?

Thank you and regards
F.

Jan 19 '08 #2
Howdy,

I don't think it matters as he populates drop down list on the client side
using callback (XMLHttpRequest ) AJAX, so the information is not persited in
viewstate, the only information being sent back to the server with HTML form
is selected value. He'd have to either serialize values to hidden field and
deserialize it on the aspx page and populate the drop down list, or populate
drop down after every postback on the client side. Fabio if you need more
explanation please don't hesitate to let us know.

Regards
--
Milosz
"JIGNESH" wrote:
Is Button a HTML Submit Button or a normal HTML Button. ?

Regards
JIGNESH

"Fabio Mastria" wrote:
Hi all!

In a my simple project I use callback to fill a dropdownlist with xml data
returned by a web service, based on a value which is input via another
dropdownlist.

NOTE: I can't use ajax/atlas.

Using javascript and callback all works... but if I press a button or any
event that raise a postback, the dropdownlist that I fill gets empty!

This also if I set its EnableViewstate property to false.

Someone can help me?

Thank you and regards
F.
Jan 19 '08 #3

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

Similar topics

1
2101
by: Kaneda | last post by:
Hello everyone! I have some weird(?) problems, and I am not quite sure if there are due to my errors or maybe a limitation in the .Net framework. I have a ComboBox I need to fill with the content of an untyped DataSet. This is to be done in the "DropDown" Event (since the dataset is empty at program start). If I go with this:
0
2727
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update not the whole page, but a portion of the page. Strangely enough the URL below http://beta.asp.net/QUICKSTARTV20/aspnet/doc/ctrlref/data/gridview.aspx (VB GridView Paging and Sorting Callbacks example)
0
3932
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen. It is almost like it is trying to implement it's own COM interfaces... below is the header, and a link to the dll+code: Zip file with header, example, and DLL:...
2
1932
by: Torben Philippsen | last post by:
Hi, I have a very simple searchform (an asp:textbox and a asp:button) I have enabled autopostback for the textbox to be able to execute the search method when the user hits the enter key. Ofcourse the search should also be executed when clicking the search button. Therefore I have added an empty eventhandler to recieve the click event. The eventhandler is empty because I handle the postback in the page_load event:
4
3401
by: Jim Hammond | last post by:
It would be udeful to be able to get the current on-screen values from a FormView that is databound to an ObjectDataSource by using a callback instead of a postback. For example: public void RaiseCallbackEvent(string eventArgs) { // update the data object with the values currently on screen FormView1.UpdateItem(true); }
0
1250
by: Zoodor | last post by:
I have a server control that contains an HtmlSelect. It currently uses postbacks to function (and works fine), but I am upgrading it to be able to use callbacks (using postback or callback, depending on a property that the page developer can set). I have two instances of the control on my page, one set to use postbacks and the other to use callbacks. When I pick a value from the select in the postback control, the value of the select in...
3
2241
by: Nahrin | last post by:
I implimented ASP.NET 2.0 Client callback script (ICallbackEventHandler) to get the result back from server without postback the page. Problem is when seesion expires or authentication times out, callback script does not do anything and hangs. If I click another key which requires postback after that, I get following error: ----------- Failed to load viewstate. The control tree into which viewstate is being loaded must match the control...
11
14812
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be processed by the web server. I am still struggling to understand this postback logic, and hope that some kind gurus out there could help me clarify the confusion I have.
0
8355
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
8866
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...
1
8550
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7381
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
6191
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
4193
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
4365
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2006
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1769
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.