#define in aspx?

  • Thread starter Thread starter mirek
  • Start date Start date
M

mirek

Hi,
Sorry for quite dumb question, but is there a way to make conditional
compliation of aspx pages? I wish I have a page that will have some
modification when build type is different (e.g. i will set a global
flag, in the project settings or code). I could mark the fragments with
#define but it won't work with content of aspx pages.

I need this to change only for a few pages without creating new project.

Regards,
mirek
 
When you say an APSX page do you mean the HTML content ?

It works in code. Though I don"t think it works inside the ASPX page, you
could use conditional compilation to set the visible porperty of some
lements to false so that what you defined inside the ASPX page is not
rendered...

Patrice
 
Hi Mirek,

This can be done, in C# (I've not used this in VB.NET), you just have

#if DEBUG
// Code in here gets included when doing a debug build
#endif

HTH,

Matt Hawley, MCAD .NET http://www.eworldui.net Hi,
Sorry for quite dumb question, but is there a way to make conditional
compliation of aspx pages? I wish I have a page that will have some
modification when build type is different (e.g. i will set a global
flag, in the project settings or code). I could mark the fragments with
#define but it won't work with content of aspx pages.

I need this to change only for a few pages without creating new project.

Regards,
mirek

[microsoft.public.dotnet.framework.aspnet]
 
Hey Matt,
While I had the chance, just wanted to say how great your components
are!!!

Best Regards,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
Mark,

Thank you! Its always great to hear that :)

Matt Hawley, MCAD .NET http://www.eworldui.net Hey Matt,
While I had the chance, just wanted to say how great your components
are!!!

Best Regards,
Mark Fitzpatrick
Microsoft MVP - FrontPage

Matt Hawley said:
Hi Mirek,

This can be done, in C# (I've not used this in VB.NET), you just have

#if DEBUG
// Code in here gets included when doing a debug build
#endif

HTH,

Matt Hawley, MCAD .NET http://www.eworldui.net Hi,
Sorry for quite dumb question, but is there a way to make conditional
compliation of aspx pages? I wish I have a page that will have some
modification when build type is different (e.g. i will set a global
flag, in the project settings or code). I could mark the fragments with
#define but it won't work with content of aspx pages.

I need this to change only for a few pages without creating new project.

Regards,
mirek

[microsoft.public.dotnet.framework.aspnet]



[microsoft.public.dotnet.framework.aspnet]
 
Matt said:
This can be done, in C# (I've not used this in VB.NET), you just have

#if DEBUG
// Code in here gets included when doing a debug build
#endif

Thanks. I think I'll do this that way but this will need to move some
code from aspx to code behind (some control properties).

Regards,
mirek
 
Patrice said:
When you say an APSX page do you mean the HTML content ?
Yes.

It works in code. Though I don"t think it works inside the ASPX page, you
could use conditional compilation to set the visible porperty of some
lements to false so that what you defined inside the ASPX page is not
rendered...

It seems that it can't be done on aspx page level but I can do that in
code behind (as there is no other method). Thnx.

Regards,
mirek
 
Back
Top