Top "Code-behind" questions

Code-behind refers to code for your UI (Windows Forms, ASP.

WPF Bind to class member in code behind

Pretty simple question, but can't seem to find a complete answer on here... I need to databind in xaml to …

c# wpf code-behind data-binding
code blocks are not supported in this context in asp.net control

I'm creating one html table. I want to hide the table row. I'm putting the attributes runat=server and id …

c# asp.net code-behind
Unable to call App_Code class from a code-behind

I have a class in a file that's in the "App_Code" folder. I'm able to use this in an "…

asp.net mono code-behind app-code
Simple LINQ and List error: WhereListIterator`1[Task]' to type 'System.Collections.Generic.List`1[Task]'

I'm having trouble understanding my error Method: public List<Task> GetAllTasks() { var AllTasks = from t in tasks where …

asp.net linq code-behind
Why to avoid the codebehind in WPF MVVM pattern?

At the article, WPF Apps With The Model-View-ViewModel Design Pattern, the author who is Josh Smith said: (1) In a well-designed …

xaml mvvm code-behind
How to Set Image Resource URI from Code-Behind

I am trying to embed a PNG graphic into a DLL and load it into an Image control as a …

wpf resources code-behind
Create DataTemplate in code behind

How do i add controls to datatemplates programmatically? For Example. Below I've created TextBlock and DataTemplate. TextBlock text = new TextBlock(); …

c# dynamic datatemplate code-behind
Add additional Css class programmatically

I have a textbox with a Css class called 'required'. When a user click a button, I'd like to add …

asp.net css code-behind
add boundField to gridview in codebehind file C#

I want to create new gridview in codebehind file asp.net C#. Exactly I want to add such boundfield to …

asp.net gridview add code-behind boundfield
Disabling all but one child control in a WPF window

I have a bunch of controls on my window. One of them is a refresh button that performs a cumbersome …

wpf xaml controls code-behind