473,767 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp.net 2.0 script callbacks

Hi

I have an app where I have 2 dropdown lists (state and city) and a Save
button. When a user selects a value from the state dropdown list, I
use script callback to populate the data for the city dropdown list.
By using script callback, I'm able to execute server side functions
without a postback.

Now here is my problem...let's say I selected Illinois and then Chicago
on the dropdown lists. After I click on Save, the city dropdown list
no longer shows Chicago as the selected value, but shows the first item
in the city dropdown list instead. It seems as if the viewstate is not
being saved/updated or the control is not refreshed correctly?

Is anyone else having this problem using script callbacks? It seems as
if I need to also change the viewstate field on the client side using
javascript?
Kelly

Jul 24 '06 #1
7 1327
You should post the code for more information but are you sure your
dropdown lists are runat=server ?

XK

kelly wrote:
Hi

I have an app where I have 2 dropdown lists (state and city) and a Save
button. When a user selects a value from the state dropdown list, I
use script callback to populate the data for the city dropdown list.
By using script callback, I'm able to execute server side functions
without a postback.

Now here is my problem...let's say I selected Illinois and then Chicago
on the dropdown lists. After I click on Save, the city dropdown list
no longer shows Chicago as the selected value, but shows the first item
in the city dropdown list instead. It seems as if the viewstate is not
being saved/updated or the control is not refreshed correctly?

Is anyone else having this problem using script callbacks? It seems as
if I need to also change the viewstate field on the client side using
javascript?
Kelly
Jul 24 '06 #2
The dropdownlists are part of a user control and I save the selected
values using the SaveControlStat e. But since I'm using script
callbacks to populate the city dropdownlist and no postback occurs, I
believe SaveControlStat e is not saving correctly.

Kelly

xke...@gmail.co m wrote:
You should post the code for more information but are you sure your
dropdown lists are runat=server ?

XK

kelly wrote:
Hi

I have an app where I have 2 dropdown lists (state and city) and a Save
button. When a user selects a value from the state dropdown list, I
use script callback to populate the data for the city dropdown list.
By using script callback, I'm able to execute server side functions
without a postback.

Now here is my problem...let's say I selected Illinois and then Chicago
on the dropdown lists. After I click on Save, the city dropdown list
no longer shows Chicago as the selected value, but shows the first item
in the city dropdown list instead. It seems as if the viewstate is not
being saved/updated or the control is not refreshed correctly?

Is anyone else having this problem using script callbacks? It seems as
if I need to also change the viewstate field on the client side using
javascript?
Kelly
Jul 24 '06 #3
Kelly,
That's correct, the simple script callback doesn't preserve the stateful
page class on the server side. You could do this with something like
Anthem.Net because it handles callbacks by actually instantiating the Page
class and preserving the page state. Find it on Sourceforge.net . Or, if you
are more adventurous, ATLAS.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"kelly" wrote:
Hi

I have an app where I have 2 dropdown lists (state and city) and a Save
button. When a user selects a value from the state dropdown list, I
use script callback to populate the data for the city dropdown list.
By using script callback, I'm able to execute server side functions
without a postback.

Now here is my problem...let's say I selected Illinois and then Chicago
on the dropdown lists. After I click on Save, the city dropdown list
no longer shows Chicago as the selected value, but shows the first item
in the city dropdown list instead. It seems as if the viewstate is not
being saved/updated or the control is not refreshed correctly?

Is anyone else having this problem using script callbacks? It seems as
if I need to also change the viewstate field on the client side using
javascript?
Kelly

Jul 24 '06 #4
Peter

Thanks for the reply...but is there a way for me to get around this in
asp.net 2.0? Since they introduced this feature, I'm sure many others
have had the same problem.
Kelly

Peter wrote:
Kelly,
That's correct, the simple script callback doesn't preserve the stateful
page class on the server side. You could do this with something like
Anthem.Net because it handles callbacks by actually instantiating the Page
class and preserving the page state. Find it on Sourceforge.net . Or, if you
are more adventurous, ATLAS.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"kelly" wrote:
Hi

I have an app where I have 2 dropdown lists (state and city) and a Save
button. When a user selects a value from the state dropdown list, I
use script callback to populate the data for the city dropdown list.
By using script callback, I'm able to execute server side functions
without a postback.

Now here is my problem...let's say I selected Illinois and then Chicago
on the dropdown lists. After I click on Save, the city dropdown list
no longer shows Chicago as the selected value, but shows the first item
in the city dropdown list instead. It seems as if the viewstate is not
being saved/updated or the control is not refreshed correctly?

Is anyone else having this problem using script callbacks? It seems as
if I need to also change the viewstate field on the client side using
javascript?
Kelly
Jul 24 '06 #5
if you are attempting to store values in the page where there is not a
postback,
you can store them in hidden fields on the page (for example), and when your
script callback is called, part of it's work would be to go get those values
and update whatever control needs to be "refreshed" via client-side
Javascript and the HTML DOM.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"kelly" wrote:
Peter

Thanks for the reply...but is there a way for me to get around this in
asp.net 2.0? Since they introduced this feature, I'm sure many others
have had the same problem.
Kelly

Peter wrote:
Kelly,
That's correct, the simple script callback doesn't preserve the stateful
page class on the server side. You could do this with something like
Anthem.Net because it handles callbacks by actually instantiating the Page
class and preserving the page state. Find it on Sourceforge.net . Or, if you
are more adventurous, ATLAS.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"kelly" wrote:
Hi
>
I have an app where I have 2 dropdown lists (state and city) and a Save
button. When a user selects a value from the state dropdown list, I
use script callback to populate the data for the city dropdown list.
By using script callback, I'm able to execute server side functions
without a postback.
>
Now here is my problem...let's say I selected Illinois and then Chicago
on the dropdown lists. After I click on Save, the city dropdown list
no longer shows Chicago as the selected value, but shows the first item
in the city dropdown list instead. It seems as if the viewstate is not
being saved/updated or the control is not refreshed correctly?
>
Is anyone else having this problem using script callbacks? It seems as
if I need to also change the viewstate field on the client side using
javascript?
>
>
Kelly
>
>

Jul 24 '06 #6
Do you know if it's possible to modify/update the ControlState from the
client side using javascript?

I am able to modify the dropdownlist values on the client side using
javascript but do not know how to modify/update the ControlState also
on the client side. The control I'm using is a complex control and it
calls LoadControlStat e when the Save button is clicked on to get the
values of the controls on the page.

Kelly

Peter wrote:
if you are attempting to store values in the page where there is not a
postback,
you can store them in hidden fields on the page (for example), and when your
script callback is called, part of it's work would be to go get those values
and update whatever control needs to be "refreshed" via client-side
Javascript and the HTML DOM.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"kelly" wrote:
Peter

Thanks for the reply...but is there a way for me to get around this in
asp.net 2.0? Since they introduced this feature, I'm sure many others
have had the same problem.
Kelly

Peter wrote:
Kelly,
That's correct, the simple script callback doesn't preserve the stateful
page class on the server side. You could do this with something like
Anthem.Net because it handles callbacks by actually instantiating the Page
class and preserving the page state. Find it on Sourceforge.net . Or, if you
are more adventurous, ATLAS.
Peter
>
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
>
>
>
>
"kelly" wrote:
>
Hi

I have an app where I have 2 dropdown lists (state and city) and a Save
button. When a user selects a value from the state dropdown list, I
use script callback to populate the data for the city dropdown list.
By using script callback, I'm able to execute server side functions
without a postback.

Now here is my problem...let's say I selected Illinois and then Chicago
on the dropdown lists. After I click on Save, the city dropdown list
no longer shows Chicago as the selected value, but shows the first item
in the city dropdown list instead. It seems as if the viewstate is not
being saved/updated or the control is not refreshed correctly?

Is anyone else having this problem using script callbacks? It seems as
if I need to also change the viewstate field on the client side using
javascript?


Kelly
Jul 24 '06 #7
Isn't ControlState a server-side property? The only thing you have on the
client side is a bunch of HTML and possibly some javacript sitting in the
browser, right?
Take a look at Anthem.Net. It will help you to understand all this better,
and save you a lot of time.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"kelly" wrote:
Do you know if it's possible to modify/update the ControlState from the
client side using javascript?

I am able to modify the dropdownlist values on the client side using
javascript but do not know how to modify/update the ControlState also
on the client side. The control I'm using is a complex control and it
calls LoadControlStat e when the Save button is clicked on to get the
values of the controls on the page.

Kelly

Peter wrote:
if you are attempting to store values in the page where there is not a
postback,
you can store them in hidden fields on the page (for example), and when your
script callback is called, part of it's work would be to go get those values
and update whatever control needs to be "refreshed" via client-side
Javascript and the HTML DOM.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"kelly" wrote:
Peter
>
Thanks for the reply...but is there a way for me to get around this in
asp.net 2.0? Since they introduced this feature, I'm sure many others
have had the same problem.
>
>
Kelly
>
Peter wrote:
Kelly,
That's correct, the simple script callback doesn't preserve the stateful
page class on the server side. You could do this with something like
Anthem.Net because it handles callbacks by actually instantiating the Page
class and preserving the page state. Find it on Sourceforge.net . Or, if you
are more adventurous, ATLAS.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"kelly" wrote:

Hi
>
I have an app where I have 2 dropdown lists (state and city) and a Save
button. When a user selects a value from the state dropdown list, I
use script callback to populate the data for the city dropdown list.
By using script callback, I'm able to execute server side functions
without a postback.
>
Now here is my problem...let's say I selected Illinois and then Chicago
on the dropdown lists. After I click on Save, the city dropdown list
no longer shows Chicago as the selected value, but shows the first item
in the city dropdown list instead. It seems as if the viewstate is not
being saved/updated or the control is not refreshed correctly?
>
Is anyone else having this problem using script callbacks? It seems as
if I need to also change the viewstate field on the client side using
javascript?
>
>
Kelly
>
>
>
>

Jul 25 '06 #8

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

Similar topics

1
2297
by: Melissa Wallis | last post by:
I have a class with 5 callbacks. Two of the callbacks work fine but the others don't. The main difference is that the callbacks that don't work are composed of a sequence of structs. I noticed a comment about this same problem on the web but no solution was noted. What makes the callbacks with the sequences so different? It seems that when one of the callbacks with a sequence is called it just hangs. I am talking to a TAO orb from...
2
279
by: Amy L. | last post by:
I have a windows service where I would like to launch a script (bat, cmd, vbs, exe, etc) from the service. This script should execute in the background and not require any input from the user (i.e. not interact with the desktop). I have been looking at System.Diagnostics.Process.Start() to launch this script. Here are my questions based on this. 1.) Is this the right namespace to be using?
0
2735
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)
5
3247
by: Christopher Jastram | last post by:
I'm a self-taught programmer, so this might be a pretty dumb question. If it is, please point me in the right direction and I shall apologize profusely. I have a question regarding C++ and object members. Can anyone help? I'm writing a C++ wrapper for a fairly old programming interface to a document editing program that has no OOP whatsoever; only tons of structs. This program has different callbacks I'm supposed to implement for...
1
2086
by: MichaelY | last post by:
While cruising through the script files that help to implement script callbacks in 2.0, I noticed that there is no code path to handle a return string that doesn't match the parsing logic - it just falls through and nothing happens. My scenario is this: My web app session times out/application error occurs when I make my script callback...my application 'normally' redirects users to the login form and/or error page (HTTP 302,...
0
1147
by: anilkoli | last post by:
I want clear cut idea about callbacks and also of delegates I have doughts about callbacks, I feel callbacks are used for 1. recursion 2. dynamically calling a perticular method out of many methods, deciding at runtime. 3. Notification
9
3345
by: zholthran | last post by:
Hi folks, after reading several threads on this issue (-> subject) I fear that I got a problem that cannot easily be solved by the offered workarounds in an acceptable way, at least not with my limited c & c++ experience. Maybe some of you can help. the problem: I need several instances of a class whose (non-static!) methods should serve as callbacks for a dll (which can' be manipulated/adapted in any
0
1113
by: aBs0lut30 | last post by:
Hi Guys, I am working on a site and recently added several client callbacks to the project. Everything works GREAT while debugging the site in visual studio. Last night I copied the site up to our test IIS box and logged in to the site only to find that none of the callbacks are working. Not seeing any errors or anything. Just nothing is happening. After a decent amount of googleing i am no closer to figuring this out than I was last...
0
1451
by: =?Utf-8?B?TG93bGFuZGVy?= | last post by:
Hello, I've built a web application that uses client script callbacks. It is used on a large network with a large variety of user OSes and IE versions. It was tested on IE 6 on different setups and IE 5.5 to a lesser degree without problems. I know of a least one user who gets an error in WebResource.axd when using the application. The same error also occurs on a simple reproduction page with just a button and a div. When the button...
0
9571
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
10009
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8835
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
7381
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
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
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...
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
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.