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

Attributes.Add question

REB
If I add this line of code to a drop down list's SelectedIndexChanged event
is there something else I should add to keep things clean?
private void ddlDriver_SelectedIndexChanged(object sender, System.EventArgs
e)

{

btnDelete.Attributes.Add("onclick","return confirm('Are you Sure you want to
delete " + ddlDriver.SelectedItem.ToString() + "?');");

}

If a user deletes 100 drivers will the button have 100 added attributes or
is it just changing a property and modifying it each time?

Should I call
btnDelete.Attributes.Clear();

or is that uneccessary?
Nov 18 '05 #1
2 1051
It'll just modify if it's already there otherwise it'll create it.

Suggestion: Why not add that attribute to the delete button when you load the page.. Do you have to use the postback event(costly) to add the onclick attribute?

----- REB wrote: -----

If I add this line of code to a drop down list's SelectedIndexChanged event
is there something else I should add to keep things clean?
private void ddlDriver_SelectedIndexChanged(object sender, System.EventArgs
e)

{

btnDelete.Attributes.Add("onclick","return confirm('Are you Sure you want to
delete " + ddlDriver.SelectedItem.ToString() + "?');");

}

If a user deletes 100 drivers will the button have 100 added attributes or
is it just changing a property and modifying it each time?

Should I call
btnDelete.Attributes.Clear();

or is that uneccessary?

Nov 18 '05 #2
REB
Thanks for the reply.

I want the pop up to have the name of the record that is being deleted so
the user can see exactly what they are deleting before they commit to it.
"REB" <ru**@bjorgaard.com> wrote in message
news:uK**************@TK2MSFTNGP09.phx.gbl...
If I add this line of code to a drop down list's SelectedIndexChanged event is there something else I should add to keep things clean?
private void ddlDriver_SelectedIndexChanged(object sender, System.EventArgs e)

{

btnDelete.Attributes.Add("onclick","return confirm('Are you Sure you want to delete " + ddlDriver.SelectedItem.ToString() + "?');");

}

If a user deletes 100 drivers will the button have 100 added attributes or
is it just changing a property and modifying it each time?

Should I call
btnDelete.Attributes.Clear();

or is that uneccessary?

Nov 18 '05 #3

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

Similar topics

6
by: beliavsky | last post by:
I have started using classes with Python and have a question about their use. In Python, 'attributes are all "public" and "virtual" in C++ terms; they're all accessible everywhere and all looked...
8
by: Matthew Bell | last post by:
Hi, I've got a question about whether there are any issues with directly calling attributes and/or methods of a threaded class instance. I wonder if someone could give me some advice on this. ...
1
by: John L. Clark | last post by:
I am curious as to the rationale, and effect, of having default namespaces not applying (directly) to attributes (see http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute without a...
7
by: Info 3000 | last post by:
Hello, I'm beginner in XML. I have just a little question : I understand that I can write : <Book> <Title> A nice day </Title> <Author> James Nicepen </Author> </Book>
6
by: Developer | last post by:
Hello, I'm experimenting with and XmlTextReader sample, and don't understand how the attributes are being processed. Here's the input: <xsd:element name="AA" type="BB"...
8
by: Thomas Girod | last post by:
Hi there. I'm trying to get a list of attributes from a class. The dir() function seems to be convenient, but unfortunately it lists to much - i don't need the methods, neither the built-in...
1
by: Gérard Talbot | last post by:
Hello, According to DOM 2 Core, the attribute "nodeRef.attributes" is "A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise."...
28
by: Alan Isaac | last post by:
I have a class whose instances should only receive attribute assignments for attributes that were created at inititialization. If slots are not appropriate, what is the Pythonic design for this? ...
2
by: james_027 | last post by:
hi everyone, I am now in chapter 5 of Dive Into Python and I have some question about it. From what I understand in the book is you define class attributes & data attributes like this in python...
26
by: tjhnson | last post by:
Hi, With properties, attributes and methods seem very similar. I was wondering what techniques people use to give clues to end users as to which 'things' are methods and which are attributes. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.