Hi Deeshubby76,
Welcome to MSDN newsgroup.
Regarding on the problem you mentioned, I'm thinking it should be a page
specific issue. How many pages in your application suffer this problem? As
for the http headers and data you posted, the different between the two
page request are the Post Data's form format. Generally there're two form
formats:
The default value for this attribute is
"application/x-www-form-urlencoded". (mapped to your second http
message....) and another is "multipart/form-data" which should be used in
combination with the INPUT element, type="file". (mapped to your first http
message...)
So I don't think this is the cause since the first style http message( form
data are separated...) is caused by therer'e some file upload element in
the page ,yes?
If convenient, I'd suggest you try creating a simple test page (with some
dummy data records...) which can reproduce the behavior so that we can
perform some tests on local side.
If there're anything unclear, please feel free to post here.
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Checkboxes in DataGrid are not submitting a value
| thread-index: AcX1LZihU0P5oAUdTkO1XOYB/HBZUw==
| X-WBNR-Posting-Host: 198.134.51.14
| From: "=?Utf-8?B?YnJpYW4=?=" <deeshubby76@nospam.nospam>
| Subject: Checkboxes in DataGrid are not submitting a value
| Date: Tue, 29 Nov 2005 13:41:03 -0800
| Lines: 72
| Message-ID: <2C7912E1-3352-4804-82F0-B731309400C2@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridcontrol
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.datagridcontrol:14821
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridcontrol
|
| I am familiar with creating TemplateColumns in dataGrids which contain a
| checkbox control. I have successfully implemented deletion routines,
where,
| upon a button_Click event, mulitple items are deleted from the dataGrid.
|
| For example, this loop might be inside of my button_Click events:
|
| foreach(System.Web.UI.WebControls.DataGridItem dgi in
this.dgQuestions.Items)
| {
if(((System.Web.UI.WebControls.CheckBox)dgi.FindControl("chkDelete")).Checke
d == true)
| {
| dgi.Visible = false;
| ctr++;
| }
|
| }
|
| However, I am currently baffled, as I am working on a dataGrid today, no
| different than other dataGrids I've implemented elsewhere in the same web
| application - and when I step through the code in the debugger, the
| FindControl("chkDelete") is successful, but the .Checked property always
| evaluates to False - no matter if I check every item in the grid.
|
| I have installed ieHTTPHeaders v 1.6 into my MSIE to help me view the
| headers being submitted. I have noticed a difference in how the two pages
are
| behaving...
|
| On a dataGrid containing checked checkboxes which is working correctly,
when
| I submit the page, here is a sample of how the headers are formatted
| (viewstate blob truncated a bit for brevity's sake):
|
| ************
| ************
| Cookie: WebAdmin=5BED4; adminuser=watts;
| ASP.NET_SessionId=lqahbc3cn4eqdsmklvdpityk
|
| -----------------------------7d51afb2104e
| Content-Disposition: form-data; name="__EVENTTARGET"
|
|
| -----------------------------7d51afb2104e
| Content-Disposition: form-data; name="__EVENTARGUMENT"
|
|
| -----------------------------7d51afb2104e
| Content-Disposition: form-data; name="__VIEWSTATE"
|
dDwtMTQzMzM1NjcxNzt0PDtsPGk8MT47PjtsPHQ8cDxsPGVuY3R5cGU7PjtsPG11bHRpcGFydC9m
b3JtLWRhdGE7Pj47bDxpPDE+O2k8Mj47aTw0PjtpPDY47PjtsPHQ8cDxsPGVuY3R5cGU7PjtsPG1
1bHRpcGFydC9mb3JtLWRhdGE7Pj47bDxpP
|
| Removed Checked Items
| -----------------------------7d51afb2104e
| Content-Disposition: form-data; name="dgQuestions:_ctl2:chkDelete"
|
| on
| -----------------------------7d51afb2104e
| Content-Disposition: form-data; name="dgQuestions:_ctl3:chkDelete"
|
| on
|
| *************
| *************
|
| And now, for the badly behaving dataGrid, containing checked checkboxes.
| Notice how it runs together the _EVENTSTATE, _EVENTTARGUEMENT and
_VIEWSTATE
| lines at the start of the viewstate blob, and runs together the check box
| identifiers toward the end of the blob (middle of blob truncated for
| brevity's sake):
| *************
| *************
| Cookie: WebAdmin=5BED4; adminuser=watts;
| ASP.NET_SessionId=lqahbc3cn4eqdsmklvdpityk
|
__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=dDwtMTgzNDQzMzg1ODt0PDtsPGk8MT47
PjtsPHQ8O2w8aTwwPjtpPDE%2BO2k8Mj47aTw0PjtpPDU%2BO2k8Nj47aTw3Pjs%2BO2w8dDw7bD
xpPDE%2BO2k8NT47aTw3Pjs%2BO2w8dDw7bDxpPDE%2BO2k8Mz47aTw1Pjs%2BO2w8dDxwPGw8VG
V4dDs%2BO2w8MHB4Oz4%2BOzs%2BO3Q8cDxsPFRleHQ7PjtsPHZpc2libGU7Pj47Oz47dDxwPGw8
VGV4dDs%2BO2w8bG9jYWwgd2ViIC8gbG9jYWwgZGF0YTs%2BPjs7Pjs%2BPjt0PHA8bDxUZXh0Oz
47bDxBZG1pbkhlYWRlcjFfVGl0bGVQYW5lbDs%2BPjs7Pjt0PHA8bDxUZXh0Oz47bDxkb2N1bWVu
dC50aXRsZTs%2BPjs7Pjs%2BPjt0PDtsPGk8MT47aTwzPjtpPDU%2BO2w8Y2hrRXhwYW5kUm9sZX
M7ZGdVc2VyUm9sZXM6X2N0bDI6Y2hrRGVsZXRlO2RnVXNlclJvbGVzOl9jdGwzOmNoa0RlbGV0ZT
tkZ1VzZXJSb2xlczpfY3RsNDpjaGtEZWxldGU7ZGdVc2VyUm9sZXM6X2N0bDU6Y2hrRGVsZXRlO2
RnVXNlclJvbGVzOl9jdGw2OmNoa0RlbGV0ZTs%2BPmHx5byap%2F%2FVZcP4113OmjIZ34tI&Adm
inMenu1%3ASiteDropDownList=0&AdminMenu1%3AProgramDropDownList=0&DropDownGran
tRole=Choose+a+Role%3A&btnDeleteCheckedRoles=DELETE+CHECKED+ITEMS&dgUserRole
s%3A_ctl2%3AchkDelete=on&dgUserRoles%3A_ctl3%3AchkDelete=on&dgUserRoles%3A_c
tl4%3AchkDelete=on
|