?
Solved

Early Binding in ASP.NET?

Posted on 2002-06-26
6
Medium Priority
?
453 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 4

Accepted Solution

by:
DarthPedro earned 200 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
Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

762 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