code behind

Discussion in 'ASP .Net Web Controls' started by Morris Neuman, Dec 2, 2008.

  1. Hi,

    If I am not using a code behind page (.aspx.cs), where in the regular
    content page would I include the using command (e.g. using System.Data.OleDb)?

    The start of my aspx page is as follows:

    <%@ Page Language="C#" MasterPageFile="~/MasterPage1.master"
    Title="Admin-Manage Distribution List" %>

    <script runat="server">

    protected void LinkButton2_Click(object sender, EventArgs e)
    DetailsView1.Visible = true;

    protected void DetailsView1_ItemInserted(object sender,
    DetailsViewInsertedEventArgs e)

    protected void Page_Load(object sender, EventArgs e)


    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
    <br />
    <strong><span style="color: #000080; font-family: Verdana">
    Morris Neuman, Dec 2, 2008
    1. Advertisements

  2. Morris Neuman

    Steven Cheng Guest

    Hi Morris,

    Quote from Morris==================================================
    If I am not using a code behind page (.aspx.cs), where in the regular
    content page would I include the using command (e.g. using

    To do this you can put the following tag above the <script> tag:
    <% @Import Namespace=" System.Data.OleDb" %>

    If you need further assistance please feel free to ask.


    Steven Cheng

    Microsoft MSDN Online Support Lead

    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:

    Get notification to my posts through email? Please refer to

    Note: MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 2 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions. Issues of this
    nature are best handled working with a dedicated Microsoft Support Engineer
    by contacting Microsoft Customer Support Services (CSS) at
    This posting is provided "AS IS" with no warranties, and confers no rights.

    Steven Cheng, Dec 3, 2008
    1. Advertisements

  3. Thanks. I put the <% @Import Namespace=" System.Data.OleDb" %>
    in the test.aspx page and it worked without the code behind page.

    Appreciate the help.


    Morris Neuman, Dec 3, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.