Request object doesn't include items that have a blank value

T

TS

In my production exceptions i get an email with all the form elements and
their values to debug. the controls that have a blank value are not seen and
it makes my debug job harder (was the control's value blank or was it set
invisible on server so its not in the html).

how do i access all controls whether blank or not?

thanks
 
C

Cowboy \(Gregory A. Beamer\)

In code you can iterate through the controls rather than use the form
collection. You will have to know a bit about the ctonrols and cast to the
correct type to grab their values, however.
 
S

Steven Cheng[MSFT]

Hello TS,

As for the non-value form item, do you mean the value of a certain form
item is an empty string? Based on my experience, for those server
controls (which represent html input form elements in html), as long as its
markup is rendered out in page's resposne and it is not disabled, the
postback form collection will contain its value. If you found that the
certain form item's value is empty, the only possible cause is that there
is no input data in the Control/html element. If the server control's
"Visible" is set to "false",it is not rendered out in html response and
you'll not even get it in the postback form collection.

BTW, what's the empty form value's name, is it a child control nested in
other template control(such as FormView, GridView ...)? Also, if you can
ensure the exact page that suffers this problem only, we can concentrate on
that particular page's control tree.

Please feel free to let me know if you have any new finding or have any
other questions we can help.


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
T

TS

well the thing that made me notice was a ddl (select in html) that wasn't
appearing. I thought there were other controls, but at least i know that a
select with no items won't appear.

that ddl was not set to invisible and it appeared in the html.

So you are saying that if say a textbox is disabled, then it won't be in the
form elements either huh?

thanks
 
S

Steven Cheng[MSFT]

Thanks for your reply TS,

Yes, you're right, for those particular html elements such as <select>
list, checkbox, if they have no selected item or is not checked, the
postback data is also empty.

And for disabled html element, they'll not be posted in the http request's
form collection. e.g.

<input type="text" disabled="True" />

Please feel free to let me know if you have any other questions.


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top