|
OK, I have this - and only this - in the Web.config file now:
<appSettings>
<add key="PageInspector:ServerCodeMappingSupport" value="Disabled"/>
</appSettings>
When I preview the page in the browser I get:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Module IIS Web Core
Notification Unknown
Handler Not yet determined
Error Code 0x8007000d
Config Error Configuration file '\\?\C:\Users\Steve\Documents\Visual Studio 2013\WebSites\WebSite5\web.config' does not contain a root <configuration> tag
Config File \\?\C:\Users\Steve\Documents\Visual Studio 2013\WebSites\WebSite5\web.config
Requested URL http:
Physical Path
Logon Method Not yet determined
Logon User Not yet determined
Request Tracing Directory C:\Users\Steve\Documents\IISExpress\TraceLogFiles\
Config Source:
1: ="1.0"="utf-8"
2: <appSettings>
3: <add key="PageInspector:ServerCodeMappingSupport" value="Disabled"/>
More Information:
This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
If you see the text "There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined", this error is because you are running a .NET Framework 3.5-based application in .NET Framework 4. If you are running WebMatrix, to resolve this problem, go to the Settings node to set the .NET Framework version to ".NET 2". You can also remove the extra sections from the web.config file.
|
|
|
|
|
You need to have <configuration> as the root element of the web.config file:
="1.0"
<configuration>
<appSettings>
<add key="PageInspector:ServerCodeMappingSupport" value="Disabled"/>
</appSettings>
</configuration>
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The error message I get now doesn't even seem related to my code. I get:
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30451: 'DefaultAuthenticationTypes' is not declared. It may be inaccessible due to its protection level.
Source Error:
Line 10: ' This is required if your application allows users to login
Line 11: app.UseCookieAuthentication(New CookieAuthenticationOptions() With {
Line 12: .AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
Line 13: .LoginPath = New PathString("/Account/Login")})
Line 14: app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie)
Source File: C:\Users\Steve\Documents\Visual Studio 2013\WebSites\WebSite5\App_Code\Startup.Auth.vb Line: 12
There is no reference in my code to AuthenticationType or LoginPath
I have this in Web.config as per your good self:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="PageInspector:ServerCodeMappingSupport" value="Disabled"/>
</appSettings>
</configuration>
And this in my aspx page:
<%@ Page Title="Register" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeFile="Register.aspx.vb" Inherits="Account_Register" %>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<h2><%: Title %>.</h2>
<p class="text-danger">
<asp:Literal runat="server" ID="ErrorMessage" />
</p>
<div class="form-horizontal">
<h4>Create a new account.</h4>
<hr />
<asp:ValidationSummary runat="server" CssClass="text-danger" />
<div class="form-group">
<asp:Label runat="server" AssociatedControlID="UserName" CssClass="col-md-2 control-label">User name</asp:Label>
<div class="col-md-10">
<asp:TextBox runat="server" ID="UserName" CssClass="form-control" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="UserName"
CssClass="text-danger" ErrorMessage="The user name field is required." />
</div>
</div>
<div class="form-group">
<asp:Label runat="server" AssociatedControlID="Password" CssClass="col-md-2 control-label">Password</asp:Label>
<div class="col-md-10">
<asp:TextBox runat="server" ID="Password" TextMode="Password" CssClass="form-control" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="Password"
CssClass="text-danger" ErrorMessage="The password field is required." />
</div>
</div>
<div class="form-group">
<asp:Label runat="server" AssociatedControlID="ConfirmPassword" CssClass="col-md-2 control-label">Confirm password</asp:Label>
<div class="col-md-10">
<asp:TextBox runat="server" ID="ConfirmPassword" TextMode="Password" CssClass="form-control" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="ConfirmPassword"
CssClass="text-danger" Display="Dynamic" ErrorMessage="The confirm password field is required." />
<asp:CompareValidator runat="server" ControlToCompare="Password" ControlToValidate="ConfirmPassword"
CssClass="text-danger" Display="Dynamic" ErrorMessage="The password and confirmation password do not match." />
</div>
</div>
<div class="form-group">
<asp:Label runat="server" AssociatedControlID="Email" CssClass="col-md-2 control-label">Email</asp:Label>
<div class="col-md-10">
<asp:TextBox runat="server" ID="strEmail" TextMode="Email" CssClass="form-control" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="strEmail"
CssClass="text-danger" Display="Dynamic" ErrorMessage="The email field is required." />
<asp:RegularExpressionValidator runat="server" ControlToValidate="strEmail"
CssClass="text-danger" Display="Dynamic" ErrorMessage="Please enter a valid email address."
ValidationExpression="^.+@.+$" />
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<asp:Button runat="server" OnClick="CreateUser_Click" Text="Register" CssClass="btn btn-default" />
</div>
</div>
</div>
</asp:Content>
That's it, in its entirety.
|
|
|
|
|
There must have been some additional settings in your web.config file before you deleted them to add the new setting.
Do you have a backup copy of the file? If not, you'll need to create a new ASP.NET project and copy the web.config file over.
Either way, you need to add the new setting to the existing settings; don't delete the existing content of the file!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yes, that sounds sensible.
I'll keep this project but open a New Project, insert the form fields in the aspx file and your Web.config settings in the Web.config file and go from there!!
Thank you for all these hours of your time: I'm grateful.
Blue
|
|
|
|
|
I'm playing around with counting how many users are online.
So I added this to the Global.asax file
Sub Session_Start()
guestCount = Convert.ToInt32(Application("guestCount"))
Application("guestCount") = guestCount + 1
End Sub
Sub Session_End()
Application("guestCount") = guestCount - 1
Session.Clear()
End Sub
I'm trying to access Application data in a server control, but I can't figure out how to check the existence or access the value.
This is what I have, but I'm not even close to getting it right. I thought I could access the data using something like a session value, but not the case.
Dim m As HttpApplicationState = HttpApplicationState
If Not (Application("guestCount") Is Nothing) Then
lbl_OnlineUser_Count_Field.Text = Application("guestCount")
End If
|
|
|
|
|
I feel dumb here, it is just like a session value.
If Not (HttpContext.Current.Application("guestCount") Is Nothing) Then
lbl_OnlineUser_Count_Field.Text = HttpContext.Current.Application("guestCount")
End If
|
|
|
|
|
Don't forget to add ToString() at the end
|
|
|
|
|
Oh thanks for the reminder!
It doesn't work very well at the moment, session timeouts are to long. I need to rethink how it works.
|
|
|
|
|
Did someone break the .NET 3.5 version of MicrosoftAjax.js on Windows 8.1 update 1, or is it just my PC?
Handlers added via Sys.Application.add_init work fine on the server (Windows 2008 R2), but never fire on my new PC. (Tested in Firefox 29.1)
The only difference I can find is the MicrosoftAjax.js file:
Server:
FileVersion: 3.5.30729.5458
function Sys$_Application$initialize() {
if (arguments.length !== 0) throw Error.parameterCount();
if(!this._initialized && !this._initializing) {
this._initializing = true;
window.setTimeout(Function.createDelegate(this, this._doInitialize), 0);
}
}
Local:
FileVersion: 3.5.30729.7903
function Sys$_Application$initialize() {
if (arguments.length !== 0) throw Error.parameterCount();
if(!this._initialized && !this._initializing) {
this._initializing = true;
var check, er, app = this;
function init() { if (!app._initialized) app._doInitialize(); }
var onload = function() {
Sys.UI.DomEvent.removeHandler(window, "load", onload);
init();
}
Sys.UI.DomEvent.addHandler(window, "load", onload);
if (document.addEventListener) {
try {
document.addEventListener("DOMContentLoaded", check = function() {
document.removeEventListener("DOMContentLoaded", check, false);
init();
}, false);
}
catch (er) { }
}
else if (document.attachEvent) {
if ((window == window.top) && document.documentElement.doScroll) {
var timeout, el = document.createElement("div");
check = function() {
try {
el.doScroll("left");
}
catch (er) {
timeout = window.setTimeout(check, 0);
return;
}
el = null;
init();
}
check();
}
else {
document.attachEvent("onreadystatechange", check = function() {
if (document.readyState === "complete") {
document.detachEvent("onreadystatechange", check);
init();
}
});
}
}
}
}
Yes, I know WebForms is no longer "cool", and I should have rewritten everything in the latest bleeding-edge pre-alpha CTP version of whatever was the last framework to come out of Redmond, but some of us have work to do!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Dears,
I have one problem that our system which is made by the web application ASP.net and the report made by crystal report (Visual Studio 2005) so I want printing the report without asking the printer name and the preview so can you help me to be printing as direct.
So i will be much appropriated if you send me a small sample to be print directly from web application.
Thanks
|
|
|
|
|
Are you aware of the fact that printing on the web is done on the client side? On the client's machine?
In a web page (on the client side) you may print the web page (as-is) using window.print method, or you can supply the user with a prepared file (like pdf) and open it to print. Even in the first scenario you can not ensure window.print will run automatically...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
hi
I have a datalist with som controls in it, one of them is check box,
i want have a compare with two item(click 2 checkboxes, for comparing two product in my websit) so when checked two of them and user push compareBtn my codes go to another page with 2 valu (productId)
how to do it
A Day Without Learning Is A Lost Day!
|
|
|
|
|
on your button click iterate the items in the datalist and find the ids
foreach (DataListItem item in datalist.Items)
{
if ((item.FindControl("CheckBox1") as CheckBox).Checked)
{
ids.Add((item.FindControl("LabelID") as Label).Text);
}
}
here ids is List of strings, you can add any numbers of ids
Then you could redirect to next page with these ids as query string. for example
string arry = String.Join(",", ids);
Response.Redirect("SecondPage.aspx?ids=" + arry);
in second page you can get the value of query string and split it by comma. then you have the ids to load in 2nd page.
Hope this helps you
Smooth roads never make good drivers.
Smooth sea never makes good sailors.
Clear skies never make good pilots.
Problem free life never makes a strong person.
Be strong enough to accept the challenges of life..
Don’t ask life, ‘Why me?’. Instead say, ‘Try me!’
|
|
|
|
|
how to generate database backup automaticaly daily basis in sql server I'm facing this probelm plz help me?
|
|
|
|
|
|
Just create a sql job. You can either create a maintenance plan or just create a job. Either way, it's pretty easy if you open Sql Management Studio and poke around.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
hi
i am create a bus ticket booking website. but one difficulty arise about the bus status. the bus is display after mentioned departure time.
|
|
|
|
|
Do you really think that anyone can guess from this what is happening in your application?
|
|
|
|
|
sir
this is my sql table
Bus_no Bus_Name Departure_time Seat Fare Bus_type Start Journey_date Bus_Ref Status
88 mybys 18:00:00.0000000 32 150.00 NON_AC_32 Guwahati 2013-12-12 10000001 Active
the thing is that the above bus_no active after mentioned Departure_time. and Stored_procedure in my sql is:
GO
CREATE procedure [dbo].[Add_bus]
(@Bus_Name nvarchar(max),
@Dep_Time datetime,
@Seat_Details int,
@Bus_type varchar(200),
@start nvarchar(max),
@journey_date datetime,
@bus_ref int)
as
begin
INSERT INTO [MyBus].[dbo].[Bus_Detail]
([Bus_Name]
,[Dep_Time]
,[Seat_Details]
,[Bus_Type]
,[Start]
,[Journey_Date]
,[booked_seats],[bus_ref],[BusStatus])
VALUES
(@Bus_Name,@Dep_Time,@Seat_Details,@Bus_type,@start,@journey_date,@bus_ref,'Active')
end
modified 2-Jun-14 2:41am.
|
|
|
|
|
Looks like you have the wrong number of values, 9 fields and 8 values missing booked seats
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I'm trying to develop a custom scaffolder using the new Scaffolding framework in VS2013, but I'm having some problems understanding how to use the new ASPNet.Scaffolding.Core.Metadata.ModelMetadata class. Basically, I need to create a ModelMetdata instance based on a specified DataModel type, and pass it to the T4 template. Is there a special MetaDataProvider that I need to use for this? Any help would be appreciated.
Note that I'm not using the Entity Framework, so I don't have a DBContext to work with in this case. Just a C# class with DataAnnotations.
Thanks,
John P.
|
|
|
|
|
I am increasing my row by 1 like this... is there are the better way to do this:
currentRow = currentRow + 1
|
|
|
|
|
What are you talking about?
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|