Solved

asp.net set "Debug=true"

Posted on 2010-09-15
8
671 Views
Last Modified: 2012-06-27
On m page I'm getting an error message along with the statement:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

I've included this at the top of my page:
<%@ Page Language="VB" Debug="true" AutoEventWireup="false" CodeFile="admin_whyjoin_update.aspx.vb" Inherits="_admin_whyjoin_update" ContentType="text/html" ResponseEncoding="utf-8" %>

and this in my web.config file:

<compilation debug="true" strict="false" explicit="true">
                  <assemblies>
                        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  </assemblies>
            </compilation>

But I'm still getting the error page telling me that my debug mode is off. Any ideas what I'm doing wrong? My page code is posted below. Thanks.
Code behind page (main page is below)
Imports System.Data.SqlClient
Imports System.Configuration

Partial Class _admin_whyjoin_update
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            LoadWhyJoin()
        End If
    End Sub

    Private Sub LoadWhyJoin()
        Dim conn As SqlConnection
        Dim comm As SqlCommand
        Dim reader As SqlDataReader
        Dim connectionString As String = _
        ConfigurationManager.ConnectionStrings( _
        "play3on3").ConnectionString
        conn = New SqlConnection(connectionString)
        comm = New SqlCommand( _
        "SELECT whyjoin " & _
        "FROM whyjoin " & _
        "WHERE id = 1", conn)
        Try
            conn.Open()
            reader = comm.ExecuteReader()
            If reader.Read() Then
                editor1.Text = reader.Item("whyjoin").ToString()
            End If
            reader.Close()
            updateButton.Enabled = True
        Catch
            dbErrorLabel.Text = _
            "Error loading the page content.<br />"
        Finally
            conn.Close()
        End Try
    End Sub

    Protected Sub updateButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles updateButton.Click
        Dim conn As SqlConnection
        Dim comm As SqlCommand
        Dim connectionString As String = _
        ConfigurationManager.ConnectionStrings( _
        "play3on3").ConnectionString
        conn = New SqlConnection(connectionString)
        comm = New SqlCommand( _
        "UPDATE whyjoin SET whyjoin=@whyjoin " & _
        "WHERE id=1", conn)
        comm.Parameters.Add("@whyjoin", System.Data.SqlDbType.Text)
        comm.Parameters("@whyjoin").Value = editor1.Text
        Try
            conn.Open()
            comm.ExecuteNonQuery()
        Catch
            dbErrorLabel.Text = _
            "Error updating the Why Join page.<br />"
        Finally
            conn.Close()
        End Try
        LoadWhyJoin()
    End Sub
End Class


Main page

<%@ Page Language="VB" Debug="true" AutoEventWireup="false" CodeFile="admin_whyjoin_update.aspx.vb" Inherits="_admin_whyjoin_update" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<!-- Begin CKEditor Scripts -->
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script src="ckeditor/_samples/sample.js" type="text/javascript"></script>
<link href="ckeditor/_samples/sample.css" rel="stylesheet" type="text/css" />
<!-- End CKEditor Scripts -->
    
<link href="css/styles.css" rel="stylesheet" type="text/css" />

</head>

<body onload="MM_preloadImages('images/center_bar_on.png')">
<form id="form1" runat="server">
<!-- DO NOT MOVE! The following AllWebMenus linking code section must always be placed right AFTER the BODY tag-->
<!-- ******** BEGIN ALLWEBMENUS CODE FOR menu_play3on3_edit ******** -->
<script type="text/javascript">var MenuLinkedBy="AllWebMenus [4]",awmMenuName="menu_play3on3_edit",awmBN="798";awmAltUrl="";</script><script charset="UTF-8" src="menu_play3on3_edit.js" type="text/javascript"></script><script type="text/javascript">awmBuildMenu();</script>
<!-- ******** END ALLWEBMENUS CODE FOR menu_play3on3_edit ******** -->
<!-- <div style="height:100%;"> -->
  <div id="content_edit">&nbsp;<span id="awmAnchor-menu_play3on3_edit">&nbsp;</span></div>
  <div class="left column">
    <div id="leftcol">&nbsp;</div>
  </div>
<div class="right column">
    <div id="rightcol">&nbsp;</div>
</div>
<!-- </div> -->
<div class="main_content">
<div class="main_left_edit">  
</div>

<div class="main_center_edit">
  <div class="admin_content_top"><img src="images/spacer.png" alt="spacer" width="1" height="1" /></div>
  <div class="admin_content_middle">
  Edit content for the 
    <span class="admin_page_title">Why Join</span>
 page.
<p>
<asp:Label ID="dbErrorLabel" ForeColor="Red" runat="server" />
<br />
&nbsp;
<asp:TextBox ID="editor1" class="ckeditor" runat="server" Height="144px" 
        TextMode="MultiLine" Width="809px"></asp:TextBox>
<br />
</p>
<p>
<asp:Button ID="updateButton" Text="Update Why Join Page" Width="200" 
        Enabled="False" runat="server" />
</p>
</div>
<div class="admin_content_bottom"><img src="images/spacer.png" alt="spacer" width="1" height="1" /></div>
</div>


<div class="main_right_edit">
 
</div>
</div>

<div class="clear">&nbsp;</div>
<div class="footer_bg">
  <div class="footer_center">&nbsp;</div>

</div>
</form>
</body>
</html>

Open in new window

0
Comment
Question by:elliottbenzle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 9

Accepted Solution

by:
TonyReba earned 500 total points
ID: 33688284
actually you only need these in you aspx page to debug it...

<%@ Page Language="VB" Debug="true" AutoEventWireup="false" CodeFile="admin_whyjoin_update.aspx.vb" Inherits="_admin_whyjoin_update" ContentType="text/html" ResponseEncoding="utf-8" %>
0
 
LVL 9

Expert Comment

by:TonyReba
ID: 33688290
try also running the application with F5 ,or click on the top menu,,
Debug> Star Debugging
0
 
LVL 4

Expert Comment

by:timexist
ID: 33688349
it is talk about web.config file.
you should set debug = ture there.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 4

Expert Comment

by:timexist
ID: 33688362

press F10 is step by step debug but step over functions.
press F11 will go every steps.
0
 
LVL 9

Expert Comment

by:TonyReba
ID: 33688363
yes he is doing that
 in:


<compilation debug="true" strict="false" explicit="true">
0
 
LVL 4

Expert Comment

by:timexist
ID: 33688437
Yeah, I think a reboot maybe needed, as there is no setup error for debugging.
0
 
LVL 8

Expert Comment

by:Mohit Vijay
ID: 33688524
1. check, a pdb file should also be in bin/debug folder.
2. check if your configuration mode is release or debug? if its release change it to debug.
3. Yes, You only need to set debug mode in web.config level, it will apply debugging true for all pages, but if you setting it page level, it will page by page.
0
 
LVL 8

Expert Comment

by:Mohit Vijay
ID: 33688526
if make debug="false" you will not get this error, but you will not be able to debug your application.
0

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question