By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,173 Members | 1,079 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,173 IT Pros & Developers. It's quick & easy.

Assembly and code behind

P: n/a
I’m sorry to disturb you but I have a problem on .NET development, and I’m
need some help to resolve it if it’s possible.

I have an aspx page with src property (no dll for my web application, all
pages are JIT compiled on request), and I want link a assembly with the “src”
attribute, like

<%@ Assembly Src=”/MyWebApplication/Common/MyAssemblyClass.cs” %>

This class is included in a namespace.

When I try to using this namespace in the source of my web page, runtime
compilation invokes a error who tell me that the namespace or type doesn’t
exist in the class or the namespace.

I’ve read on net some examples of using Src property for Assembly directive,
but always with aspx page with code inside…

It is possible to use this process with aspx code in a separate file, and if
yes, how can I do?

Thanks for any help, and apologize for disturbing

Best regards,
DELESTRE Christophe
v-*****@microsoft.com
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Remove the Src directive and add Inherits="YourNamespace.YourClassName" and
make sure the DLL is in ~/bin

-Brock
DevelopMentor
http://staff.develop.com/ballen
I'm sorry to disturb you but I have a problem on .NET development, and
I'm need some help to resolve it if it's possible.

I have an aspx page with src property (no dll for my web application,
all pages are JIT compiled on request), and I want link a assembly
with the "src" attribute, like

<%@ Assembly Src="/MyWebApplication/Common/MyAssemblyClass.cs" %>

This class is included in a namespace.

When I try to using this namespace in the source of my web page,
runtime compilation invokes a error who tell me that the namespace or
type doesn't exist in the class or the namespace.

I've read on net some examples of using Src property for Assembly
directive, but always with aspx page with code inside.

It is possible to use this process with aspx code in a separate file,
and if yes, how can I do?

Thanks for any help, and apologize for disturbing

Best regards,
DELESTRE Christophe
v-*****@microsoft.com


Nov 19 '05 #2

P: n/a
Hi,

Thanks for your respons, but i've no dll for my web application, all is in
code who's compile at execution.

Regards,

"Brock Allen" wrote:
Remove the Src directive and add Inherits="YourNamespace.YourClassName" and
make sure the DLL is in ~/bin

-Brock
DevelopMentor
http://staff.develop.com/ballen
I'm sorry to disturb you but I have a problem on .NET development, and
I'm need some help to resolve it if it's possible.

I have an aspx page with src property (no dll for my web application,
all pages are JIT compiled on request), and I want link a assembly
with the "src" attribute, like

<%@ Assembly Src="/MyWebApplication/Common/MyAssemblyClass.cs" %>

This class is included in a namespace.

When I try to using this namespace in the source of my web page,
runtime compilation invokes a error who tell me that the namespace or
type doesn't exist in the class or the namespace.

I've read on net some examples of using Src property for Assembly
directive, but always with aspx page with code inside.

It is possible to use this process with aspx code in a separate file,
and if yes, how can I do?

Thanks for any help, and apologize for disturbing

Best regards,
DELESTRE Christophe
v-*****@microsoft.com


Nov 19 '05 #3

P: n/a
Ah, ok, I understand now. I completely misread the entire question from your
first post.

What you'll need to do next is determine why your .cs file isn't compiling.
Do you have any more info from the error? What about the .cs file itself?
Do you know what line or method isn't compiling? Perhaps post some of it
and we can take a look?

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

Thanks for your respons, but i've no dll for my web application, all
is in code who's compile at execution.

Regards,

"Brock Allen" wrote:
Remove the Src directive and add
Inherits="YourNamespace.YourClassName" and make sure the DLL is in
~/bin

-Brock
DevelopMentor
http://staff.develop.com/ballen
I'm sorry to disturb you but I have a problem on .NET development,
and I'm need some help to resolve it if it's possible.

I have an aspx page with src property (no dll for my web
application, all pages are JIT compiled on request), and I want link
a assembly with the "src" attribute, like

<%@ Assembly Src="/MyWebApplication/Common/MyAssemblyClass.cs" %>

This class is included in a namespace.

When I try to using this namespace in the source of my web page,
runtime compilation invokes a error who tell me that the namespace
or type doesn't exist in the class or the namespace.

I've read on net some examples of using Src property for Assembly
directive, but always with aspx page with code inside.

It is possible to use this process with aspx code in a separate
file, and if yes, how can I do?

Thanks for any help, and apologize for disturbing

Best regards,
DELESTRE Christophe
v-*****@microsoft.com


Nov 19 '05 #4

P: n/a
Hi,

Yes i can put few lines of code to more explain what i need to do :)

first i have my aspx page with theses directives:
<%@ Import Namespace="Microsoft.MSCOM.MNP.Framework"%>
<%@ Assembly Name="MNP.Framework, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=a75671c2b10b8543" %>
<%@ Assembly Src="/EUGA/Common/Translation.cs" %>
<%@ Import Namespace="EUGA.Framework.Translation" %>
<%@ Page language="c#" Codebehind="AdvancedSearch.aspx.cs"
Src="AdvancedSearch.aspx.cs" AutoEventWireup="false"
Inherits="EUGA.fr.AdvancedSearch" ValidateRequest="false"%>

As you can see i use a assembly directive with a source property, indicate
path to .cs file

This is a part of my .cs file:
namespace EUGA.Framework.Translation
{
/// <summary>
/// Translation class for EUGA Sites
/// </summary>
public class TranslationProcess
{
// Object for Translation
protected XmlDocument _xmlResource;
private HttpContext _context;
private string _page;

/// <summary>
/// constructor
/// </summary>
/// <param name="thd">thread</param>
/// <param name="pagename">page name</param>
/// <param name="pagename">culture info</param>
public TranslationProcess(Thread thd, string pagename, CultureInfo
cultureInfo)
{
....

and this a part of my aspx.cs code (which is not compiled in dll remind you
:)):
using System;
using System.Text;
using System.Collections;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Threading;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using EUGA.Framework;
using EUGA.Framework.DAL.Countries;
using EUGA.Framework.DAL.Regions;
using EUGA.Framework.DAL.Cities;
using EUGA.Framework.DAL.Organisations;
using EUGA.Framework.DAL.Purposes;
using EUGA.Framework.DAL.Employees;
using EUGA.Framework.DAL.Activities;
using EUGA.Framework.DAL.UserProfile;
//using EUGA.Framework.Localization;
using EUGA.Framework.Translation;

using Microsoft.MSCOM.MNP.Framework;

namespace EUGA.fr
{
/// <summary>
/// This page display forms to make a Grant's search
/// </summary>
public class AdvancedSearch : Microsoft.MSCOM.MNP.Framework.Page
{
....

When i try to display this page on IE, i have this error:
unable to found namespace or type in EUGA.Framework 'Translation'

it seems to not be able to link the assembly i've created in the .cs file

It's enough cleat for you or do you want more explain ?

If you prefer i can let u my work email : v-*****@microsoft.com

Great thanks,

"Brock Allen" wrote:
Ah, ok, I understand now. I completely misread the entire question from your
first post.

What you'll need to do next is determine why your .cs file isn't compiling.
Do you have any more info from the error? What about the .cs file itself?
Do you know what line or method isn't compiling? Perhaps post some of it
and we can take a look?

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

Thanks for your respons, but i've no dll for my web application, all
is in code who's compile at execution.

Regards,

"Brock Allen" wrote:
Remove the Src directive and add
Inherits="YourNamespace.YourClassName" and make sure the DLL is in
~/bin

-Brock
DevelopMentor
http://staff.develop.com/ballen
I'm sorry to disturb you but I have a problem on .NET development,
and I'm need some help to resolve it if it's possible.

I have an aspx page with src property (no dll for my web
application, all pages are JIT compiled on request), and I want link
a assembly with the "src" attribute, like

<%@ Assembly Src="/MyWebApplication/Common/MyAssemblyClass.cs" %>

This class is included in a namespace.

When I try to using this namespace in the source of my web page,
runtime compilation invokes a error who tell me that the namespace
or type doesn't exist in the class or the namespace.

I've read on net some examples of using Src property for Assembly
directive, but always with aspx page with code inside.

It is possible to use this process with aspx code in a separate
file, and if yes, how can I do?

Thanks for any help, and apologize for disturbing

Best regards,
DELESTRE Christophe
v-*****@microsoft.com


Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.