codebehind

N2 CMS - where are the codebehind files?

I'm using the N2 CMS system for ASP.NET. Well I say 'using', I'm really just trying to develop a tiny understanding of it. One of the things that's obstructing me is that it's set up in a way I've not seen before. Where are the codebehind files for the pages? Can anyone tell me for example, where is the code for /Edit/default.aspx? How...

Save values in code behind asp

I have a aspx page. I have another class and stored procedure. From the aspx page I call a funtion (Term.ShowTerm()) and save data to txtInfo[]. I want to use that info (these variables) after a user reloads the page (a postback -> btnSymptoms_Click for example), but txtInfo resets its value. Is it possible somehow to save these value? ...

ASP.NET: cannot find [name].designer.aspx.cs in VS2010

maybe it's a dumb question, how can i see the designer generated codebehind files (named .designer.aspx.cs) in VS2010? i need it to wireup form events when i disable autowireup option at @form. ...

ASP.Net server-side navigation menu based on html contents

I need to do some styling to a bunch of webforms, containing articles formatted in a rather uniform way. I can change any source code I want. What I need is a quick way to dynamically create a navigation menu (on the server side) for an ASP.NET webform, based on contents of a specified div. For example, given the following HTML: <div ...

one codebehind method handles two distinct dropdowns - isn't supposed to

Hello folks, I have one page with two dropdownlists with different IDs and in my codebehind I have two distinct methods, one for each dropdownlist, with distinct names and handlers. BUT, in my codebehind, only one dropdownlist calls it's method - and sometimes it calls both methods! - while the other dropdownlist never calls its method...

Programmatically reference items rendered by ItemsControl from code behind

I have a Silverlight user control that contains an ItemsControl that renders a StackPanel containing another user control for each item in the data source, the XAML is as follows: <Grid x:Name="LayoutRoot"> <ItemsControl ItemsSource="{Binding}" x:Name="ValuesItemSource"> <ItemsControl.ItemsPanel> <ItemsPanelTempl...

Moving the javascript code to design view is not working. Only code-behind Attributes.Add("onclick" works. Puzzled

I wanted to disable a button after it is clicked and at the same time fire the post back event to generate a report. My first set of code did not work because soon after the button is disabled the page won't submit/post back. here's the first set of code which was not implemented. the onclientclick calls a javascript function which has t...

ASP.NET databinding / getting variables from codebehind

So I haven't used ASP.NET for three years or so and I'm really rusty on it. My old code isn't available to me for review (at an old company). This question should be pretty basic, but I can't find any good or reliable or not-super-old resources on the issue, so I'm asking here. Can I get a general overview of databinding again? I rememb...

Adding UI Components in C# WPF in Code behind

Hi, I'm new to C# and WPF format. In my program, I have an array of strings with text, and I want to create a button in the canvas for each string in the array. I've used flex, and in that i can use the addChild command to put something in something else, but I haven't figured out how to do it in WPF yet. Any help would be appreciated, t...

Button Handler in codebehind C# WPF

Hi, I created some buttons in Code like this. if (infoLoader.categoriesLoaded) { sideBarButtons = new Button[infoLoader.categoriesLength]; for (int i = 0; i < sideBarButtons.Length; i++) { sideBarButtons[i] = new Button(); sideBarButtons[i].Content = infoLoader....

How to access a user control's fields and methods without regitering the control?

Hello, I have a ASP.Net project that is setup in such a way that it can be dropped into any site and "just work." All the paths are relative to the current file, not relative to the "~". The paths are determined by ThePath = this.TemplateSourceDirectory; This is working for everything expect registering a custom control that is created...

How to use WPF's asterisk size value in codebehind?

I create some control in codebehind and would like to set its size dynamically. I can assign numerical values as well as System.Windows.GridLength.Auto, but there is no equivalent to "*". Is that because the "*" from XAML gets translated into code when the WPF gets parsed? To give this some detail: There is a grid with three rows. I wan...

xClassNotDerivedFromElement error when adding Code Behind to Resource Dictionary in silverlight

I need to add code behind class to Resource Dictionary as described in this question. (I know that this is not a good practise but it should work based on the comments for linked question) .I'm referencing the code with x:Class attribute: XAML (separate Resource Dictionary file): <ResourceDictionary xmlns="http://schemas.microsoft....

Designing all pages completely in the codebehind?

Our current web portal at work was a port from a classic ASP codebase. Currently, all pages in our project extend a custom Page class called PortalPage. It handles login/logout, provides access to a public User object for the currently authenticated user, and adds the standard page header and footer to all of our pages. Every Page in ou...

Removing codebehind files from WPF MVVM projects

Hi, I am coding a WPF application using MVVM pattern. I don't need to have codebehind files for my user controls. What is the best way to remove these files elegantly? I can create a user control class then I can use this class for my all views. (for more info: http://sondreb.com/blog/post/No-Code-Behind-for-MVVM.aspx) Are there any a...

Execute ClientSide before ServerSide in ASP.NET

I am using ASP.NET 3.5. When the user click on say btnSubmit I want to first execute some JavaScript code and then execute some C#/VB.NET code. Is this possible? If so how would one do it? Thanks in advanced! ...

Technical code into the ViewModel in wpf ?

I have a UserControl with some custom dependency properties bound to a clr property in the ViewModel. The ViewModel has application logic where I deal with the TextPointer/TextRange classes with a FlowDocument. Should I put that stuff into the code-behind of the UserControl or in the ViewModel? ranges.Clear(); TextRange ran...

Using Ajax to call code-behind function?

I have a java-script function that displays options on a web page and a C# function that stores preferences in a database. I need some way for said java-script to also execute my C# function. I think this is possible with AJAX, but I am not entirely sure (I've never used AJAX before). I've read some tutorials (w3schools), however none...

Silverlight: How to implement CodeBehind code in XAML

There is an int property of the 'CustomControl' (in Silverlight 4 application), TextBlock is displayed inside of the 'Canvas' control: <Canvas Name="canvas" > <Ellipse Fill="Yellow" Canvas.Top="8" Canvas.Left="8" Height="16" Width="16"> </Ellipse> <TextBlock Name="TeamNumberTextBlock" Text="9" Canvas.Top="8" Canvas.Left="8" ...

Add a list of self created web user controls to a listview in codebehind fails

Hi. I have a listview which I would like to fill with self created user controls.But the problem is that the properties in the user control is not set. The usercontrols are displayed but the property values I enter is not set. Why is that? Here is the aspx code. <div id="productView" class="productsMain"> <div id="groupHeader...