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

control.Attributes.Add() not working properly

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.Re cID)
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
Nov 18 '05 #1
3 4202
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 Traveler" <hi*********************@yahoo.com> wrote in message
news:e8*************@TK2MSFTNGP14.phx.gbl...
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.Re cID)
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

Nov 18 '05 #2
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.

"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:em*************@TK2MSFTNGP12.phx.gbl...
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 Traveler" <hi*********************@yahoo.com> wrote in message
news:e8*************@TK2MSFTNGP14.phx.gbl...
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.Re cID)
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


Nov 18 '05 #3
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)
"A Traveler" <hi*********************@yahoo.com> wrote in message
news:Oo*************@tk2msftngp13.phx.gbl...
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.

"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:em*************@TK2MSFTNGP12.phx.gbl...
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 Traveler" <hi*********************@yahoo.com> wrote in message
news:e8*************@TK2MSFTNGP14.phx.gbl...
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.Re cID)
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



Nov 18 '05 #4

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

Similar topics

7
by: Sky | last post by:
What I have currently: I have a user control called mod_container.aspx that is basically two divs -- the top a toolbar, that expands/collapse the second div which can contain other...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
3
by: Shevek | last post by:
Hi All, Hope someone can help! I am building an Event Calendar app based around the Calendar WebControl which builds an SQL string based on the SelectedDates property which is passed to...
6
by: Selden McCabe | last post by:
I have a form with a bunch of image buttons. When the user moves the mouse over a button, I want to do two things: 1. change the Imagebutton's picture, and 2. make another control visible. I'm...
8
by: david | last post by:
I have developed a web form by using visual Studio. My question is: (1) what is the problem? (2) what is right way to do it? In the form, there are labels with id: lblWear, lblColor, and...
6
by: RSH | last post by:
I have a situation where I am successfully adding an Onload to the Body tag from the codebehind from a page using the following code: Protected WithEvents body1 As...
0
by: Anonieko | last post by:
Are there any javascript codes there? Answer: Yes On the PageLoad event call InitialClientControsl as follows /// <summary> /// This will add client-side event handlers for most of the...
0
by: Eniac | last post by:
Hi, I've been working on a custom user control that needs to be modified and the validation is causing me headaches. The control used to generate a table of 4 rows x 7 columns to display all...
8
by: Brad Walton | last post by:
Hello. First post, but been doing a bit of reading here. I am working on a project in Java, but decided to switch over to C# after seeing some of the additional features I can get from C#. One of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.