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

PostBack data extreme odity!!

Hi,

I've had the opportunity to witness an very strange thing during the
LoadPostData() of one of my forms.

The problem is that only some of the fields in the form are filled with
the PostBack data. Theese fields are the ones that are not linked to a
"RequiredFieldValidator".

All the fields are encapsulated within UserControl elements. I use this
UserControl elements in other pages and they work just fine. The only
difference is that in other web forms theese controls are created and
added in the code behind while in this forms they're added manually in
the designer.

The save button just posts back, no other operations involved. All
fields should be repopulated with the postback data but the required
ones aren't.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
2 1028
Not sure this will help, but it will point you in the right direction.

Behind the scenes, a lot goes on to get form controls filled. In your
scenario, you are doing two things that reduce the chance of success. The
first, using a user control, is quite common, and should not, by itself,
cause any issues, unless you have the control set up incorrectly. The second,
dynamically adding controls, however, is likely to blow up. The reason is
simple: You are stepping outside of the declarative model of the framework.

What this means is you will have to control state of the controls by
grabbing the information and making sure it is placed and retrieved from
ViewState.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Luis Ferrao" wrote:
Hi,

I've had the opportunity to witness an very strange thing during the
LoadPostData() of one of my forms.

The problem is that only some of the fields in the form are filled with
the PostBack data. Theese fields are the ones that are not linked to a
"RequiredFieldValidator".

All the fields are encapsulated within UserControl elements. I use this
UserControl elements in other pages and they work just fine. The only
difference is that in other web forms theese controls are created and
added in the code behind while in this forms they're added manually in
the designer.

The save button just posts back, no other operations involved. All
fields should be repopulated with the postback data but the required
ones aren't.

*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #2
That's what i thought as well but from what i've read recently the last
part of your reply is not correct.

The repopulation of the form fields doesn't use the View State. It uses
something else called "PostBack Data". This is according to this article
from MSDN:

http://msdn.microsoft.com/asp.net/de...ry/en-us/dnasp
p/html/viewstate.asp#viewstate_topic2

But for the rest of the message you might actualy have pointed me in the
right direction, i'm goint to look into it.

Thank you,

Luis

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #3

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

Similar topics

2
by: Duwayne | last post by:
I am having lots of trouble with one of my user controls (ascx) not automatically loading postback data. An image on the aspx page starts the postback and the parent has no problem loading it's own...
0
by: DKode | last post by:
Hello, I am trying to call a UserControl after postback to save data filled out on that usercontrol to sql server. The problem I am having is this, I have 2 LinkButtons that I have setup as...
4
by: Gaetan | last post by:
I have an ASP.Net 1.1 application using datagrid. I am trying to handle conditions where the users post back an updated datagrid after the session times out. The results are not pretty. Sometimes...
4
by: jrett | last post by:
I'm new to ASP.NET and fairly inexperienced with web development in general, but I've been a professional software dev for over 10 years, C++, Unix and windows, C# the past 4 years. I've been...
0
by: db007 | last post by:
I have a problem at the moment with a web project. I have two Panels within an UpdatePanel on an aspx page (using Masterpages). I'm using ASP.Net 2.0 with an AJAX enabled website. The two...
4
by: =?Utf-8?B?RHlsYW5TbWl0aA==?= | last post by:
I have a WebForm where I'm dynamically creating some controls and I'm having difficulty understanding how the state is being persisted and how to work with it. I've created a simplified example...
0
by: rvdnieuwenhuizen | last post by:
Hi, The problem I cannot seem to solve: I have a page with a button control. In the On_Click eventhandler I dynamically add one TextBox each time the button is clicked. I add the textboxes to...
1
by: m.a | last post by:
Hello, I want to investigate that data that is send to server during a postback. I want to know it so I can optimize the postback data to speed up the postback. It seems that my current...
7
by: kkshansid | last post by:
i want to know what is most trusted way for form validation javascript or php?? i also want to know what technology is used by naukri.com
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...
0
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,...

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.