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;
    SetFocus(DetailsView1);
    //DetailsView1.Focus();
    }


    protected void DetailsView1_ItemInserted(object sender,
    DetailsViewInsertedEventArgs e)
    {
    GridView1.DataBind();
    }


    protected void Page_Load(object sender, EventArgs e)
    {

    }
    </script>

    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
    Runat="Server">
    <br />
    <strong><span style="color: #000080; font-family: Verdana">
     
    Morris Neuman, Dec 2, 2008
    #1
    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
    System.Data.OleDb)?
    ==================================================

    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.

    Sincerely,

    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
    http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

    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
    http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.


    --------------------
     
    Steven Cheng, Dec 3, 2008
    #2
    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


     
    Morris Neuman, Dec 3, 2008
    #3
    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.