Questions tagged [page-directives]
24 questions
32
votes
2 answers
ASP.NET @Register vs. @Reference
I'm working with referencing user controls on my ASPX page and I'm wondering what the difference is between these two page directives.
@Reference
@Register

contactmatt
- 18,116
- 40
- 128
- 186
5
votes
2 answers
What is a Page Directive in .NET
I'm studying up for a Microsoft Certification exam, and some of the wording for the 'content' in the examn confused me. In the MS exam website, under Developing Web Form Pages, it says in regard to the content on the exam...
This objective may…

contactmatt
- 18,116
- 40
- 128
- 186
5
votes
1 answer
Converting CodeFile to CodeBehind
So I seem to have some difficulties with making my CodeFile reference into CodeBehind. Before you ask, I do not have Visual Studio and I'm not on Windows. The code is being hosted on an IIS server that I have access to.
<% @Page Language="C#"…
user798080
4
votes
1 answer
How to set Async Page Directive Dynamically so Async Methods work
I am writing some Utility code to send off emails Async.
var mailClient = new SmtpClient(smtpHost);
mailClient.SendCompleted += new SendCompletedEventHandler(mailClient_SendCompleted);
using (var mailMessage = new MailMessage())
{
if…

BigBlondeViking
- 3,853
- 1
- 32
- 28
3
votes
2 answers
Create a custom ASP.NET (not MVC) directive possible?
I'm working on a somewhat advanced custom framework for some websites I'm developing at work, and I'm implementing a small plugin system for it. I want to register the plugins somehow in the ASPX file so I can then hook into the different page…

DARKGuy
- 843
- 1
- 12
- 34
2
votes
3 answers
ASP.NET Directive Convention for Declaring Client-Side Includes
I am loading .aspx and .ascx files as StreamReader.
I want each file to register it's javascript and stylesheet dependencies in some declaration like a <%@ ClientDependency path="~/Scripts/jquery-1.4.1.min.js" %>.
Is there an existing convention…

smartcaveman
- 41,281
- 29
- 127
- 212
2
votes
1 answer
Setting Content-Type and Status-Code in JSP
Its a two part question.
Part 1: I want to set the content-type of jsp page depending on the Accept header for which I'm doing

Kainix
- 1,186
- 3
- 21
- 33
2
votes
1 answer
JSP Page Directive
I have 2 difference page directive codes in my jsp, i don't know what is the difference between contentType, charset, and pageEncoding, i read thru Oracle JSP Globalization Support but didn't understand quite well , can anyone explain the difference…

hades
- 4,294
- 9
- 46
- 71
2
votes
1 answer
can we extend multiple classes in jsp page using export attribute
We can define multiple attributes in a single page directive or we can have multiple page directives in a single JSP page. But can we extend multiple classes in any jsp page using extends attribute?
for eg:
<%@ page extends="Class1" %>
<%@ page…

User_86
- 265
- 1
- 4
- 13
2
votes
1 answer
Why do I need to modify buffer and autoflush attributes in a JSP?
I don't understand why I need to modify the buffer and autoflush attributes in JSP, what do they do? What could happen if I do not modify them?

zer0uno
- 7,521
- 13
- 57
- 86
2
votes
2 answers
web-inf and jsp page directives
i have a number of jsp files under web-inf folder. Inside my web.xml i specify an errorppage for 404 amd 403 and java.lang.exception. Do i need to include a page directive for each of my jsp's or will they automatically get forwarded to the…
luckoftheirish
1
vote
1 answer
What's the equivalent of C++'s "#ifdef #endif" macro in JSP?
What's the equivalent of C++'s #ifdef #endif macro in JSP?
Is there such thing in JSP?
I want to conditionally include files in one JSP or another.
Reason for doing that is because I have a nested setup (nested jquery ui tabs). I prefer to include…

ytw
- 1,335
- 2
- 20
- 42
1
vote
1 answer
How to Include a HTML file outside my web-application into a JSP inside my application
I have a HTML Page at a Web Publisher whose content i want to load in a JSP inside my web application. I have tried JSP:Include action and Include directive but both of them seem to take only relative path. I cannot have a local copy of that html…

Nani
- 11
- 2
0
votes
3 answers
Set StyleSheetTheme in @Page directive in ASP.NET
I have a property in asp.net application
ABPS.PRR.WEB.CurrentSession.Theme
and I'm setting it in @Page directive in aspx pages like:
<%@ Page StylesheetTheme="ABPS.PRR.WEB.CurrentSession.Theme" Title="Default" ... %>
but I'm getting runtime…

hotcoder
- 3,176
- 10
- 58
- 96
0
votes
1 answer
Is there any performance overhead if I use a lot of <%@ Register directives on markup?
Some of my pages have a lot of <%@ Register directives for controls that are no longer used neither on markup nor dynamically created.
I'm wondering if I would benefit or gain some performance if I bother on removing all those directives from all…

alonso.torres
- 1,199
- 2
- 12
- 26