A very basic page with trace=true doesnt work.

G

Guest

I have installed visual studio .net and now i started to write the first few
examples from the 70-315 book by Kalani.

It looks like all server side code that i put between <% %> doesnt process
from an aspx file. Even a page with <%@ Page Language = "c#" Trace="True" %>
doesnt show the trace information.

If i create an .asp file, the server side code between <% %> will process
and display correctly on the page.

Im really clueless since every friend I ask tells me it should work fine.

Regards,

Bruno
 
G

Guest

Hi Bruno,

Make sure that 'enabled = "true" ' under <trace> node in the web.config file.

Even though you set it true in the page directive...it'll be overriden by
this application level setting available in the web.config file.

cheers,

Jerome. M
 
G

Guest

Hi Jerome,

Thx for trying to help me,

I am not even to work with web.config file. I am just creating a single
aspx file. here is my code :

<!-- StepByStep1_3.aspx -->
<%@ Page Language="C#" Trace="true" %>
<html>
<body>
Trace Information
</body>
</html>

And what I get is a blank web page when the results should be Request
Details, Trace Information, Control Tree.. etc..

Even this :

<%@ Page Language="c#"%>
<html>
<body>
<%
Response.Output.Write("Physical Path of page is:
{0}<br>",MapPath("GuidedPracticeExercise1_1.aspx"));
Response.Output.Write("# of controls on page: {0}<br>",Controls.Count);
Response.Output.Write("The Value for IsPostback: {0}<br>",IsPostBack);
Response.Output.Write("View State is:
{0}<br>",EnableViewState==true?"Enabled":"Disabled");
%>
</body>
</html>

Returns me a blank page. It looks like all C# code isnt processed at all.
If i create a single .asp page and i put server code between <% %> tags it
will work and display fine.

Odd thing is that I had it to work fine the first time I installed .net.
Now that I have reinstalled my pc, and did the same .net installation I have
this problem. In my second code example, am I suppose to have intellisense
or something between <% %> tags? because im not having it.

Thx,

Bruno
 
G

Guest

Hi Bruno,

I noticed that in the Page attributes code you havent mentioned that you
want the Pageoutput ="True" this by deafult is false and hence you are able
to see the trace on the page itself.

To view your trace goto to the following URL "/YourWebDirectiory/trace.axd"
in your current situation.

Or if you want to see the trace output on your page add a PageOutput="True"
attribute to the page.

e.g <%@ Page Language="C#" Trace="true" PageOutput = "true" %>


****************************
Hope this helps,

Shaun, M.C.P
http://blogs.wwwcoder.com/shaunakp
****************************

PageOutput
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top