control.Attributes.Add() not working properly

A

A Traveler

Hello,

I have a textbox in a datagrid row which has autopostback. When it posts
back, it updates a prop on an object in a session variable.
In order to update the right object, in the ItemDataBound of the grid, i was
adding the objects ID property as a
MyTextbox.Attributes.Add("recid",rowDataItemObj.RecID)
along with several other attributes.

For some reason these attributes are not being added the first time through.
But when do a postback, then they get added properly. The code adding the
attributes is not enclosed in any IsPostback checks.

anyone ever had this problem before, or can help?

Thanks in advance,
- ArthurDent
 
H

Hermit Dave

hahahah i would have loved to start by saying listen monkeyman (you would
have thought it was Zaphod Bebblebox) but i will presume the role of Ford
Prefect for now.

Arthur,
Would you might posting some code on what you are doing where ? if you have
your hands full... maybe i could send marvin around to have a look
Its easier to look at code and say it might be 'cause of this reason.. etc

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
 
A

A Traveler

hehehehehe! Youre the first person whose picked up on that. LOL. Thanks for
the offer, but i dont think Marvin would help... things are crazy enough at
work, dont need a despondent robot bringing in a mood. !! :)

Actually i got it fixed... it was one of those stupid things where you look
at it for an hour, then as soon as you ask about it, and look at the code
again, BAM! it hits you square in the nose what was wrong. No, it wasnt in
an IsPostback check, but it was in a different IF check, and i got so caught
up in the seeming posbtack issue that i missed the other. As soon as i
looked away to post and looked back again, it was glaring obvious.

Thanks though.
CheerZ -
- Arthur Dent.
 
H

Hermit Dave

hey it would be stupid of me not to pickup Authur Dent.... read the book...
heard the radio series.. infact BBC 4 is currently doing the Tertiary Phase
of Hitchhikers Guide to the Galaxy.

And glad you got it sorted. I know what you mean... been there done that..

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
 

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,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top