Link in HTML to go to .aspx page - asp.net

I have a html page index.html that link to a page default.aspx, both are in my root directory and working fine. The index.html contains a flash object that contains the link to default.aspx. However I want to replace the index page to a normal html page with no flash and I want to move the location of default.aspx to a secure directory. When I do this the default.aspx page does not load, instead I get an error message:
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Only Content controls are allowed directly in a content page that contains Content controls.
Source Error:
Line 224:
Line 225:
Line 226:
Source File: /mcc/default.aspx Line: 226
Does anyone know what I have to do to resolve this

As per my guess, you might be using a "Master Page" and you have given "html/body" tags in the aspx page which is not allowed. So, either use a master page and have a ContentPlaceHolder in the aspx page or remove the master page and have everything in you aspx page directly. My suggestion would be to go with a master page.
Hope this Helps!!

Related

Page rendering differently when default.aspx was modified

I have code deployed on IIS server, i just tried to modify some html content in Default.aspx page to show site was in "under construction" mode then later i brought back Default.aspx page as it was in original stage (i had copy of original Default.aspx).
I also added app_offline.html file to root directory to bring site to offline, now removed this file from root.
But now when we access the website IIS renders differently and give actual result only after 6-7 refreshes.
I tried to restart IIS server as i read that iis server is rendering new change structure and forgotten old rendering pattern. But this did not work.
Note: I do not have source code to debug i have only files .aspx files and dll files which are deployed at server.
The content to show that the site was "under construction" should have been placed in the app_offline.html file. I don't understand why you even touched the Default.aspx page. Either way the Default page may now be out of synch with its code-behind file. You don't say how much code, if any, is in the code-behind file. So an option for you now would be to create a new Default.aspx and copy/paste and markup and code involved.
Try fiddler to find out the navigation path. This will help you understand where your request is going.

XML Parsing Error: not well-formed ASP.NET

I Published a website using VS2012, ASP.NET C#, the publish succeeds however, when i open the .ASPX file, this shows ups:
XML Parsing Error: not well-formed
Location: file:///E:/Test/Default.aspx
Line Number 1, Column 2:
<%# page language="C#" autoeventwireup="true" inherits="_Default, App_Web_bf0k3pjd" maintainScrollPositionOnPostBack="true" %>
-^
any idea?
The file location should give a hint. That's a location on the file system and not being passed through a web server. When you view it using file:// then the browser simply displays the contents. The #Page directive in the first line doesn't conform to XML/XHTML/HTML standards so it throws this error. The browser knows nothing about the #Page or anything else in the page except the bits that are HTML. It will still attempt to display all the content, but it really doesn't know what to do with it other than view it as a plain html page. If you run this through an actual web server you shouldn't see this error and the page should be processed properly.

Grid view row command in asp.net?

In web application, in asp.net i am using one grid view, in that i have one link button, in row command event i am binding the url to that link, when i am clicking on that it is logging out, it is coming to login page. In row command i am writing the code like this
Response.Redirect(s, false);
where s containt the url like abc/abc_approval/xyz.aspx. it is giving particularly that url only remaing urls redirecting to their destinations.
when it comes to login page the url like this
Login.aspx?ReturnUrl=%2fabc%2fabc_Approval%2fxyz.aspx
help me please.
This does not seem the problem of redirect, you may have authentication failed on abc/abc_approval/xyz.aspx or any error could cause the redirect to login page. In web.config check the customErrors tag, Login page might be the default for unhandled errors. Put debugger on the suspected page to see if any error occurs.

Why some of WebResource.axd file for Telerik control does not load initially?

I have some telerik controls on my page. When I run this page first time, some of WebResource.axd file does not load. It shows 404 Not Found Error. but when I refresh my page couple of times, the missing file comes and some other WebResource.axd shows 404 Not Found Error.
I checked httpHandlers in web.config, and it is correctly written.
Here is my screen clips:-
In other tab:-
After refreshing couple of times :-
Do you combine and compress the Telerik javascripts in your master layout file? If so can you please share that piece of code?
It should be similar to;
Html.Telerik().ScriptRegistrar()
.Scripts(scripts => scripts
.AddGroup("CalendarGroup", group =>group
.Add("telerik.common.min.js")
.Add("telerik.calendar.min.js")
.Add("telerik.datepicker.min.js")
.Combined(true)
.Compress(true)
You should add all the javascripts that's required by the Telerik controls that you use in your app.
(Assumption : Telerik MVC is being used)

url has /errorpath

I have an issue when I try to access an ASPX page. This aspx page has nothing but the page attribute with codeFile and inherits. Its corresponding aspx.cs file has the code that writes to the aspx file. Everything works fine in my Dev enviornment. When I try to deploy the same in test server and access the page by clicking an hyperlink, I get the foll url
http://tb..hosting.net/review/Search.aspx?aspxerrorpath=/review/Create-xml-writer.aspx
and lands in search.aspx instead of Create-xml-writer.aspx
But the url should be,
http://tb.hosting.net/review/Create-xml-writer.aspx
I did a couple of build and deployed. Still i get the same issue. What does this errorpath=/ mean?
The errorpath part is something that gets passed into a custom error page when an error occurs in ASP.Net, it contains the path of the page that has the problem.
Is search.aspx defined as a custom error page in your web.config file? Turn custom errors off in your web.config file and you should see the actual error message.

Resources