Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > asp.net 2.0 script callbacks

Reply
Thread Tools

asp.net 2.0 script callbacks

 
 
kelly
Guest
Posts: n/a
 
      07-24-2006
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

 
Reply With Quote
 
 
 
 
xkeops@gmail.com
Guest
Posts: n/a
 
      07-24-2006
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


 
Reply With Quote
 
 
 
 
kelly
Guest
Posts: n/a
 
      07-24-2006
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

(E-Mail Removed) 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


 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      07-24-2006
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
>
>

 
Reply With Quote
 
kelly
Guest
Posts: n/a
 
      07-24-2006
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
> >
> >


 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      07-24-2006
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
> > >
> > >

>
>

 
Reply With Quote
 
kelly
Guest
Posts: n/a
 
      07-24-2006
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
> > > >
> > > >

> >
> >


 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      07-25-2006
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
> > > > >
> > > > >
> > >
> > >

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute a script from another script and other script does notdo busy wait. Rajat Python 3 01-08-2010 02:05 PM
handling asynchronous callbacks from c++ in a python script Tim Spens Python 1 01-24-2008 06:34 AM
Odd script error when using client script callbacks (ASP.NET 2.0) =?Utf-8?B?TG93bGFuZGVy?= ASP .Net 0 03-27-2007 10:30 PM
Client script callbacks not working outside Visual Studio aBs0lut30 ASP .Net 0 08-10-2006 07:49 PM
ASP.NET ICallbackHandler - Script callbacks.... =?Utf-8?B?TWljaGFlbFk=?= ASP .Net 1 01-22-2006 12:50 AM



Advertisments