Early Binding in ASP.NET?

Posted on 2002-06-26
Last Modified: 2012-05-04
Pardon my ignorance, but I have to ask.

It would help tremendously if I had intellisense in my ASP.NET pages.  I don't mean the HTML tags but the scripting tags.

For example:

suppose you have a sub like this

sub page_load(Sender As Object, E As EventArgs)
    Message.Text = "You last accessed this page at: " & DateTime.Now
end sub

and you have an object on your form called Message like this:

<asp:label id="Message" font-size="24" font-bold="true" runat="server" />

Ok now, why can't I get intellisense on the page_load sub?

ie. Message.Text or DateTime.Now??

Is it a early binding issue?  If this can be done, is there someone that could help me with this?  Thanks
Question by:mleopard
  • 3
  • 3

Accepted Solution

DarthPedro earned 50 total points
ID: 7111148
Are you using the code-behind feature in VS.NET, or putting all of the source code and tags in a single ASPX page?

Intellisense seems to work fine if you are using code behind.  As a matter of fact, if you drag-and-drop a web control from the toolbox onto the form everything gets setup correctly:  a protected member variable gets added to your Page object for each control on the page.  Then, using that object gives you the intellisense that you're looking for on your .CS

If you're not using the VS.NET wizards to create the ASPX pages, you won't get code-behind by default but you can turn it on manually as well.  If you're interested in doing that, let me know.

Author Comment

ID: 7111364
Currently all my code is in the aspx file.  I will try the dropping and dragging feature and see if that will work.  I am so used to manually typing in the HTML that maybe an oversight was in the makings.  I will post back my results. Thanks for the response.

Author Comment

ID: 7111378
Ok I still could not get Intellisense in the aspx file but it worked fine with the code behind.  I'll just go that route since it seems to be friendlier to use.  Thanks for your input and let me know if there is something else that I might be missing that would allow intellisense to work in an aspx page.  
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.


Expert Comment

ID: 7111382
You can still use the page-behind feature without using the drag-drop on the form (if you like typing in the HTML).  That feature just puts all of the page code into a .CS or .VB file and those editors have the intellisense feature.

If you put the following tag at the top of your page, you can create a separate file for your code:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="EETestApps.WebForm1" %>

The .CS file is the file where you place your code.  The EETestApps.WebForm1 property is the name of your page class.  Here is the starting code for the page class.

namespace EETestApps
     public class WebForm1 : System.Web.UI.Page
          protected System.Web.UI.WebControls.DropDownList TestDropDown;

          private void Page_Load(object sender, System.EventArgs e)

Expert Comment

ID: 7111384
I don't think the ASPX editor has intellisense, only the language editors.

Author Comment

ID: 7111394
Thanks for the help.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Get list of word ducuments in a folder 10 35
Error on Add method 1 37
Angular JS Route 3 47
Javascript and Jquery not firing 9 39
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now