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

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 1307
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 SaveControlState. But since I'm using script
callbacks to populate the city dropdownlist and no postback occurs, I
believe SaveControlState is not saving correctly.

Kelly

xke...@gmail.com 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 LoadControlState 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 LoadControlState 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
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...
2
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...
0
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...
5
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...
1
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...
0
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...
9
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...
0
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...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.