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.

learn more… | top users | synonyms

0
votes
0answers
17 views

The ConnectionString property has not been initialized sqlcommand yet code still works

I've always been a fan of "if it ain't broke dont fix it" but my code, although functioning, is throwing the connectionstring property has not been initialized message. similar posts suggest the ...
0
votes
1answer
20 views

Show/Hide table when checkbox is checked

Is there a way to show/hide a table when checkbox is checked? I've done it with JavaScript, but would like to know if it can be done from code behind. Protected Sub chkAccept1_CheckedChanged(sender ...
3
votes
2answers
43 views

Inline C# code vs Page_Load method

I am working on an ASP.NET Web Application. I have two files -> example.aspx and its code behind example.aspx.cs I am wondering what the difference is between putting inline C# code at the top of ...
0
votes
2answers
33 views

ASP.NET C# Button OnClick even not firing

I've absolutely exhausted Google and I can't find a solution to this problem. When click a button on my .aspx page, the corresponding function is not called from .aspx.cs file. I'll just post my code ...
0
votes
2answers
39 views

Calling code behind method from javascript?

I have method in code behind: protected void myMethod() { Literal1.Text = System.DateTime.Now.ToString(); } I need to call this method every second. I found that i should use ...
0
votes
0answers
25 views

asp.net reusing class methods from another codebehind aspx.cs

I have 2 aspx pages A and B which share the same logic on codebehind aspx.cs except for 1 method and i am thinking to reuse the code of A by letting class of B inherit the class of A in the codebehind ...
1
vote
1answer
32 views

VB.NET insert a variable from code behind into aspx img src

I'm trying to use a variable from my code behind as the src for an image. Here is what I have, but it isn't working. In my code behind at class level I have: Dim maxImage As String = ...
0
votes
1answer
39 views

acess signalr hub class methods from code behind

Is it possible to execute a public method declared in a signalr hub from the code behind of a webforms page? I have found examples of how to send a message to the client from the code behind using ...
0
votes
1answer
33 views

How do I get attached properties to work in code-behind

I'm trying to get attached properties to work in code behind, but I'm clearly missing something. As I understand it result should be "test", but it is string.Empty. The LogicalTreeHelper states that ...
-3
votes
1answer
51 views

I want to insert a record in DB and then need to return a row

I want to insert a record in DB and then need to return a row. I created the query but how to use that in .cs (C# code) This is my query @ledgerId numeric(18,0) , @voucherNo varchar(MAX) , ...
0
votes
1answer
50 views

ASP.NET codebehind changes do not show up

I am trying to make changes to the C# codebehind for an asp.net file. After compiling and publishing it in Visual Studio, none of the changes in aspx.cs appear, while changes to the aspx file do. I ...
1
vote
3answers
70 views

SetFocus to Control From Code Behind with JavaScript

I am trying to set focus to a page control (Textbox) by using the registerStartupScript method. However, I have been unsuccessful. Here is what I have tried: ...
0
votes
0answers
48 views

asp.net code behind and javascript

I have two scripts called from two different onclick events in my codebehind. I guess it was working properly but now one of my function is not getting called. I am using following way for calling my ...
2
votes
1answer
65 views

Site using code behind files from the wrong directory?

What settings in ASP.NET determine where (as in which directorie(s)) a website will look for its code-behind files? I have two versions of an asp.net c# website, Live and Dev. Live site: ...
1
vote
2answers
58 views

I want to be able to draw lines in codebehind for webpage

I'm looking at being able to draw lines in code behind in C#, for a webpage created in Visual Studio. They will be just vertical lines but must be able to change size, depending on other variables. ...

1 2 3 4 5 54
15 30 50 per page