Solved

Early Binding in ASP.NET?

Posted on 2002-06-26
6
449 Views
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
0
Comment
Question by:mleopard
  • 3
  • 3
6 Comments
 
LVL 4

Accepted Solution

by:
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 asp.net 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.
0
 

Author Comment

by:mleopard
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.
0
 

Author Comment

by:mleopard
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.  
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 4

Expert Comment

by:DarthPedro
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)
          {
                 ...
                }
        }
}
0
 
LVL 4

Expert Comment

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

Author Comment

by:mleopard
ID: 7111394
Thanks for the help.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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