Questions tagged [code-behind]

Code-behind refers to code for your UI (Windows Forms, ASP.NET page, etc.) contained within a separate class file. This allows separation of the UI and the logic behind it.

Code-behind refers to code for your UI (Windows Forms, ASP.NET page, etc.) contained within a separate class file. This allows separation of the UI and the logic behind it.

1955 questions
0
votes
1 answer

How to define an UploadFile function on a BasePage so that it can be reused on many aspx pages

I am trying to move an UploadFile function to a BasePage so that I can re-use it on many aspx pages. My original code is as follows: upload.aspx.cs public partial class upload : CodeBasePage { protected void uploadFile_Click(object sender,…
Gloria
  • 1,305
  • 5
  • 22
  • 57
0
votes
2 answers

Dynamically generating buttons in ASP.NET and passing values to Codebehind

I'm using a foreach loop to generate content how do I listen for a button click to call codebehind function. I can't set a value for a ASP button. How should I go about this ? When the user clicks on a button I want the ID for the user they clicked…
user3922757
  • 305
  • 2
  • 5
  • 14
0
votes
1 answer

How to add rows to GridView in asp.net c# application

I've already searched many articles on this page and couldn not find the answer that would fit me. Ok i have two projects (one is server(host) and one is client). The first one is ASP.NET Empty Web Application and the second one is ASP.NET Web Forms…
aiden87
  • 929
  • 8
  • 25
  • 52
0
votes
1 answer

After converting a Website project to a Web Application project, why am I unable to access the public fields of the code behind file with inline code?

So I'm attempting to convert a website project to a web application project. I created the new web application project, moved over the files, created and populated the designer files for each ASPX and ASCX file, and included those files. Once done I…
Licht
  • 1,079
  • 1
  • 12
  • 27
0
votes
1 answer

How to get access to controls from CB when using hub - Windows Phone 8.1

I'm writing app in Windows Phone 8.1 and I want to get access to controls from Code-Behind. Normally everything works great but when I use hub I don't have access to fields from Code-Behind.
Tomiak
  • 78
  • 6
0
votes
1 answer

Refresh page and open new new window

I have a page that displays some content inside a lightbox, within this content there is a Button (btnAccept) to confirm. I want to refresh the page and open a new window(or the other way around) all this from codeBehind (c#) . I will appreciate any…
Carlos
  • 377
  • 5
  • 24
0
votes
1 answer

Code Behind Problems (Adobe Premiere CC Extension)

i am new to this topic so sorry if i am missing some basics. i want to make a adobe premiere CC extension in Flash Builder 4.6 with Adobe Extension Builder 2.1, and i want to keep the application logic away from the design. I have read Flex: How to…
0
votes
1 answer

How to change style of DIV element in view from controller?

I have the following div in my view:
REVIEW:

<%:ViewData["Review"]%>

How can I set DIV visibility to visible inside of controller when…
gene
  • 2,098
  • 7
  • 40
  • 98
0
votes
1 answer

How can I get the value of a control whose ID was passed to javascript function from code behind

I'm not sure how to handle the issue to get a value of the control if its ID was passed to a function from code behind. I have a function called StateSelect that is added to a control in code behind. It has parameters. The last parameter is…
gene
  • 2,098
  • 7
  • 40
  • 98
0
votes
1 answer

Handling Maximum request length exceeded error

Is there a way I can display a message box saying that the file uploaded is greater than 4 MB. the following code in the code behind cs file does not work if (FileUploader.PostedFile.ContentType == "application/pdf" &&…
Shomaail
  • 493
  • 9
  • 30
0
votes
1 answer

Multiple datafields in boundfield using codebehind

I am pulling a first name and last name from a SQL table, running it through a datatable and binding the datable to a gridview. Instead of having two different columns in my gridview, I would like to put the first and last name in the same column.…
user-44651
  • 3,924
  • 6
  • 41
  • 87
0
votes
1 answer

ObjectDataSource update event not firing, even when I add the parameters in code behind

I am having a problem where a DetailsView will not update the table. Firstly some background. we have an old access system that I am slowly (when I get the time) porting asp.net. I have written a Data access layer that the database object classes…
wassaza
  • 15
  • 6
0
votes
1 answer

Asp.net Calendar - Generating dates

as a part of a project, i'm trying to create a Calendar in Asp.net purely from codebehind with C# I'm using a repeater and filling it content from the codebehind which is working fine. I can use the Datetime to get todays date month etc. But when im…
Andreas Hald
  • 215
  • 3
  • 13
0
votes
2 answers

Dim value disappears vb.net

I'm trying to store a value in code behind so I don't have to clog my page with HiddenFields, but the value 'disappears' I'm assuming it has to do with either scope or byval vs byref, but I don't know how I need to do it for it to work. What I've…
thokin
  • 5
  • 4
0
votes
2 answers

Input string was not in a correct format error in ASP.NET using C#

I'm trying to retrieve a data from a table and subtract it to another variable, but I'm getting this error Input string was not in a correct format. Here is my code: SqlConnection con1 = new…
Joe Marie
  • 346
  • 2
  • 8
  • 22
1 2 3
99
100