Questions tagged [behavior]

Use this tag only when [behavior] is the name of a language/framework construct.

References

1062 questions
74
votes
11 answers

ListItems attributes in a DropDownList are lost on postback?

A coworker showed me this: He has a DropDownList and a button on a web page. Here's the code behind: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ListItem item = new ListItem("1"); …
David Hodgson
  • 10,104
  • 17
  • 56
  • 77
57
votes
6 answers

What's the difference between Control.Select() and Control.Focus()?

In WinForms, to set focus to a specific control, I always seem to wind up calling Control.Select() and Control.Focus() to get it to work. What is the difference, and is this the correct approach?
Neil Barnwell
  • 41,080
  • 29
  • 148
  • 220
45
votes
2 answers

Why do two strings separated by space concatenate in Ruby?

Why does this work in Ruby: "foo" "bar" # => "foobar" I'm unsure as to why the strings were concatenated instead of a syntax error being given. I'm curious as to whether or not this is expected behavior and whether or not it's something the parser…
Lukas
  • 3,175
  • 2
  • 25
  • 34
45
votes
2 answers

jQuery textarea append newline behavior

I'm trying to append a strings which end in newlines to a textarea using jQuery. However, different newline tokens show different behavior in Firefox3.5 and IE8, and I can't seem to find a way to use something that works for both browsers. \n works…
Suan
  • 34,563
  • 13
  • 47
  • 61
34
votes
3 answers

Is there a reference of default keyboard behaviours for Silverlight 4 controls?

In the official Microsoft documentation there's only one paragraph mentioning how controls behave to keyboard (at least what I could find): http://msdn.microsoft.com/en-us/library/cc189015(v=VS.95).aspx#inputting_text Text Input and…
dain
  • 6,475
  • 1
  • 38
  • 47
33
votes
3 answers

Remove/reset CSS behavior property

Is it possible to remove the IE-specific behavior CSS property via a more specific rule or the !important declaration? Example: .a-rule { behavior: url(/some.htc); } .a-rule.more-specific { behavior: /*no HTC*/ } I realize that overriding CSS…
Jeremy Kauffman
  • 10,293
  • 5
  • 42
  • 52
28
votes
4 answers

Interactivity.Behavior vs attached properties

I'm trying to find some differences between these approaches. Is there any situation where behaviors are used and the same functionality could not be done with attached properties?
Zim
  • 585
  • 2
  • 8
  • 15
27
votes
5 answers

Trouble understanding Object State, Behavior, and Identity?

I have been instructed by my professor to introduce myself on a page as if I were an object, and that I must address three things: 1) Object State, 2) Behavior, and 3) Identity. However, I am still really confused as to how I would go about doing…
TheNewGuy
  • 411
  • 1
  • 7
  • 13
25
votes
2 answers

Coordinator layout custom layout behavior never getting called

Firstly, I'd like to preface this with my lack of knowledge about the coordinator layout. I'm merely following tutorials I found online and am curious why my behavior isn't working. Does the child view inside of coordinator layout have to be app…
cj1098
  • 1,560
  • 6
  • 32
  • 60
22
votes
6 answers

What's the best way to attach behavior to a Meteor Collection?

In Meteor, when you retrieve a record from a database, it's only a record. So if I have a collection called Dogs, a dog might have fur: 'brown' or breath: 'stinky', but it doesn't have a bark() method. Obviously, I could create some functions that…
Samo
  • 8,202
  • 13
  • 58
  • 95
20
votes
4 answers

Validation in Xamarin using DataAnnotation

I am trying to add validations in Xamarin. For that I have used this post as a reference point: Validation using Data Annotation. Following is my Behavior. public class EntryValidationBehavior : Behavior { private Entry…
Safi Mustafa
  • 515
  • 7
  • 22
20
votes
2 answers

Client Web Browser Behavior When Handling 301 Redirect

The RFC seems to suggest that the client should permanently cache the response: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 10.3.2 301 Moved Permanently The requested resource has been assigned a new permanent URI and any future…
20
votes
1 answer

Installing Propel behaviours with Composer

I'm currently developing on Windows with WampServer and have Composer working (with OpenSSL), with Propel installed without issue, and everything seems to work fine. However, my project now needs to make use of the Equal Nest Behaviour found here. I…
LeonardChallis
  • 7,759
  • 6
  • 45
  • 76
19
votes
2 answers

Why do HTML entity names with dec < 255 not require semicolon?

In a plain HTML document £ (dec 163) renders as £ without needing the ;, whereas &oelig (dec 339) will only render a œ with the semicolon. It seems that every html entity with a decimal value under 255 will render without needing the semicolon,…
bryc
  • 12,710
  • 6
  • 41
  • 61
18
votes
4 answers

Using Angular, how do I bind a click event to an element and on click, slide a sibling element down and up?

I'm working with Angular and I'm having trouble doing something that I normally use jQuery for. I want to bind a click event to an element and on click, slide a sibling element down and up. This is what the jQuery would look…
Michael Lynch
  • 2,682
  • 3
  • 31
  • 59
1
2 3
70 71