473,386 Members | 1,873 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,386 software developers and data experts.

Postback Question

I've got an ASP.NET application running that has a non-visual user
interface (it's a voice app using VXML.) The voice client understands
cookies and when it requests and aspx page, what actually gets
returned is VXML code. I'd like to be able to postback data to my
page. I can send data with no problem (using VXML submit with method
post) but at the server IsPostBack is always false.

How does the server determine if it is a PostBack? I know there is a
hidden field called ViewState, but if I set that to the current view
state when I create the VXML and allow it to be posted back, it makes
no difference.

Any ideas would be appreciated.

Thanks,
Bryan
Nov 19 '05 #1
6 1805
Bryan,

You could set a viewstate value on page load:

Dim PagePostBack As Boolean = CType(ViewState.Item("PagePostBack"), Bool)

Viewstate.Add("PagePostBack", True)

'---And then on every page load get/check/reset that value.
If PagePostBack Then
'---Page was posted back.
End If
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bryan" <ne**@bpglennon.com> wrote in message
news:lv********************************@4ax.com...
I've got an ASP.NET application running that has a non-visual user
interface (it's a voice app using VXML.) The voice client understands
cookies and when it requests and aspx page, what actually gets
returned is VXML code. I'd like to be able to postback data to my
page. I can send data with no problem (using VXML submit with method
post) but at the server IsPostBack is always false.

How does the server determine if it is a PostBack? I know there is a
hidden field called ViewState, but if I set that to the current view
state when I create the VXML and allow it to be posted back, it makes
no difference.

Any ideas would be appreciated.

Thanks,
Bryan

Nov 19 '05 #2
I have similar problems. It is easy to determine there has been no PostBack.
How for example to force a PostBack when a control's click event is raised
is what I would like to learn.

The 2.0 MasterPages are confusing and FUBAR. When a child control such as a
LinkButton is within a Panel the LinkButton will not PostBack. The controls
disappear from the ViewState. Poof.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
message news:et**************@TK2MSFTNGP14.phx.gbl...
Bryan,

You could set a viewstate value on page load:

Dim PagePostBack As Boolean = CType(ViewState.Item("PagePostBack"), Bool)

Viewstate.Add("PagePostBack", True)

'---And then on every page load get/check/reset that value.
If PagePostBack Then
'---Page was posted back.
End If
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bryan" <ne**@bpglennon.com> wrote in message
news:lv********************************@4ax.com...
I've got an ASP.NET application running that has a non-visual user
interface (it's a voice app using VXML.) The voice client understands
cookies and when it requests and aspx page, what actually gets
returned is VXML code. I'd like to be able to postback data to my
page. I can send data with no problem (using VXML submit with method
post) but at the server IsPostBack is always false.

How does the server determine if it is a PostBack? I know there is a
hidden field called ViewState, but if I set that to the current view
state when I create the VXML and allow it to be posted back, it makes
no difference.

Any ideas would be appreciated.

Thanks,
Bryan


Nov 19 '05 #3
Justin -
It looks like my ViewState is not being maintained across calls. I
added this code to the PageLoad method:

Object o = this.ViewState["PagePostBack"];
if(o == null){
Logger.Write("First time");
this.ViewState["PagePostBack"] = true;
}else{
bool b = (bool)this.ViewState["PagePostBack"];
Logger.Write("Not null: " + b);
}

I always see the first log message. Just FYI this is .NET 1.1. Why
would the view state be getting reset?

Thanks,
Bryan

On Fri, 9 Sep 2005 09:43:18 -0500, "S. Justin Gengo"
<sjgengo@[no_spam_please]aboutfortunate.com> wrote:
Bryan,

You could set a viewstate value on page load:

Dim PagePostBack As Boolean = CType(ViewState.Item("PagePostBack"), Bool)

Viewstate.Add("PagePostBack", True)

'---And then on every page load get/check/reset that value.
If PagePostBack Then
'---Page was posted back.
End If

Nov 19 '05 #4
the server knows its a postback by checking if viewstate is not null and
valid. this changes the logic of the current page processing cycle, casing
the loadpostbackdata event to fire (which is how asp.net control get their
postback values). for security the viewstate is encrypted, and checked on
postback, so you have to send a viewstate that matches the page.

-- bruce (sqlwork.com)

"Bryan" <ne**@bpglennon.com> wrote in message
news:lv********************************@4ax.com...
I've got an ASP.NET application running that has a non-visual user
interface (it's a voice app using VXML.) The voice client understands
cookies and when it requests and aspx page, what actually gets
returned is VXML code. I'd like to be able to postback data to my
page. I can send data with no problem (using VXML submit with method
post) but at the server IsPostBack is always false.

How does the server determine if it is a PostBack? I know there is a
hidden field called ViewState, but if I set that to the current view
state when I create the VXML and allow it to be posted back, it makes
no difference.

Any ideas would be appreciated.

Thanks,
Bryan

Nov 19 '05 #5
Bruce Barker wrote:
the server knows its a postback by checking if viewstate is not null
and valid. this changes the logic of the current page processing
cycle, casing the loadpostbackdata event to fire (which is how
asp.net control get their postback values). for security the
viewstate is encrypted, and checked on postback, so you have to send
a viewstate that matches the page.


Bruce,

ASP.NET actually uses two different methods to determine if we're in a
postback. First it checks to see if the Request.Forms is null. If it is,
IsPostBack is false. Otherwise, it checks the _fPageLayoutChanged property
which tells us whether or not the control tree has changed. If this is
true, IsPostBack will evaluate to false. The value of viewstate is actually
not used other than as a part of the forms collection.

Just as an aside, viewstate is actually Base64 encoded and not encrypted.
:)

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003


Nov 19 '05 #6
Ahhh, so if we solve this then the normal IsPostBack will probably work and
you won't have to create your own.

I've never done any voice applications, so I don't know if it will act
differently. Normally though there is a ViewState property of the page to
set using viewstate to true or false. The first thing I'd do is make certain
that is set to true.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bryan" <ne**@bpglennon.com> wrote in message
news:la********************************@4ax.com...
Justin -
It looks like my ViewState is not being maintained across calls. I
added this code to the PageLoad method:

Object o = this.ViewState["PagePostBack"];
if(o == null){
Logger.Write("First time");
this.ViewState["PagePostBack"] = true;
}else{
bool b = (bool)this.ViewState["PagePostBack"];
Logger.Write("Not null: " + b);
}

I always see the first log message. Just FYI this is .NET 1.1. Why
would the view state be getting reset?

Thanks,
Bryan

On Fri, 9 Sep 2005 09:43:18 -0500, "S. Justin Gengo"
<sjgengo@[no_spam_please]aboutfortunate.com> wrote:
Bryan,

You could set a viewstate value on page load:

Dim PagePostBack As Boolean = CType(ViewState.Item("PagePostBack"), Bool)

Viewstate.Add("PagePostBack", True)

'---And then on every page load get/check/reset that value.
If PagePostBack Then
'---Page was posted back.
End If

Nov 19 '05 #7

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

Similar topics

2
by: JollyK | last post by:
Hi friends, This is my question.... From the Page Load event (or Page Init event), I would need to find which event had occurred that caused a PostBack, for example was it a event fired from...
5
by: Matthew Louden | last post by:
I created simple ASP.NET web application to test how AutoPostBack property in a web control works. I set AutoPostBack property to be true of a web control. When I run the application, here's the...
3
by: Jeremy | last post by:
I have an ASPX page with a bunch of System.Web.UI.WebControls.Button controls on it. By default, clicking on any of these causes a Postback. I'd like to have it so that for a couple of these...
9
by: Robert Galvin | last post by:
Is it possible to tell which control caused a postback?
3
by: Aleksandr Ayzin | last post by:
Hi, Basic question about PostBack: would it be accurate to say that PostBack is a direct result of triggered event that happened on the form(button clicked, text typed into textbox, so on). Is...
21
by: Martin Eyles | last post by:
I am trying to get javascript to cause a page to post back. I have tried calling _doPostBack from my script, but generates an error "object expected". I think this is because the page's script...
1
by: Marcus | last post by:
I have a problem maybe one of you could help me with. I've created a data entry screen with lots of dynamically-created client-side controls. I create HTML texboxes client-side by assigning a...
8
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the...
2
by: brad | last post by:
Group, I'm using Visual Studio 2003 to create an ASP.NET 1.1 project which contains nested server user controls in order to create a tree-like hierarchy. The tree is a sort of question and...
4
by: Peter | last post by:
ASP.NET I have an application which use ASP.NET Autocomplete extender which works great. But I have a question how to update all the fields on the screen using Ajax. Users starts typing in a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...

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.