Visual Studio ASP.NET aspx page empty lines bug - c#

I am creating an ASP.NET app in Visual Studio 2013 which has about 12 pages. However, in one of the page's aspx page in VS, when I save or auto format the page it will insert/create hundreds of empty lines. Most recently it has managed to create over 300,000 lines.
I keep deleting these lines, which is quite time consuming because the lines are spread throughout the code, but they just keep getting inserted.
This bug does not occur on any other page, the only thing that is different about this page is that it uses a DevExpress ASPxPageControl, but I'm not sure how that would have anything to do with it.
I have tried deleting the page and copying the code over to a new page, but the same bug keeps occuring. Does anybody have any idea how I would go about fixing this bug?
UPDATE: I have created another page which also uses the DevExpress ASPxPageControl and it has started to happen on this as well. So I am assuming that this issue has to do with the control.
UPDATE 19/09: This issue no longer happens, but I have no idea why or how it has been fixed.
UPDATE 06/12: The issue appears to happen only when design view is opened. If I only ever look at the source view, it never happens.

There is a question that looks like the same problem you have.
Try checking if you are missing any closing tags.

Related

Generating static HTML on build time in ASP.NET Core 6

I have a bit of data stored in a file that I would like to display on a Razor Page in my project. The obvious thing to do would be to just read the file in the .cshtml.cs file, pass it in the model, and display it. That, or caching.
The file, however, won't change often (if at all), and any time it would change, would be accompanied by the code of the app itself changing, so a build would be necessary one way or another.
That's how I got the idea of somehow generating the desired HTML on build time.
I know that, on build time, .cshtml files are compiled into regular C#, and I was looking for a way to, perhaps, hook into this process somehow. Alas, without much success.
My other attempt was a .razor file, rendered in a Static way, with data fetched in ObInitializedAsync() which was supposed to run only once per component. However, I think that hosting this component in a Razor page interfered with it somehow, and the code was running on every page load. That, or I misunderstood the lifecycle in the first place.
I even went as far as making a .cs-only component and manually using the RenderTreeBuilder from an overridden BuildRenderTree, but it also seems to render per page load.
Lastly, I briefly considered using a source generator to create a partial, but alas, source generators can't read files, so that attempt also failed.
I'm, quite frankly, out of ideas at this point. Hence the question, perhaps someone else had the same issue, or knows something I don't.

Adding '/[x]' to any aspx page still shows the page, expected 404

no idea where to start on this one, but here goes. if i've missed an answer somewhere is becuase i don't know how to search for the error.
take a aspx page i.e. www.example.com/about when testing i have found (accidently i must say) that adding /anything i.e. www.example.com/about/eduhdbbw still returns the www.example.com/about page (assuming www.example.com/about/eduhdbbw doesn't exist). i would expect a 404 in this situation but i don't really know how it is routing to the original page.
fyi i'm using VS 2017 community with iis and asp.net webforms with c# and the error occurs in vs and compiled in iis. if any other info is needed please ask.
Edit: the about page does indeed show .aspx in the browser url. Also i am using a blank webform template, so it didn't come with anything pre-installed and i've not written and url re-write.
Pathinfo sound like it might be something but would this affect a project with just basic aspx and code behind, amd basically no other dependancy?
Also for now i am just using absolutepath to compare the page name and sending to 404 if it doesn't math; but it seems like a sloppy solution to have on every page...

Razor Generator adding empty comment lines in razor view

I have started using Visual Studio 2017 recently (moved from VS 2015). First thing i noticed my razore views are not compiling changes in generated files (generated cs files stay the same despite changes in cshtml files). When I tried to right click and select Run Custom Tool it showed me message which implies to install Razor Generator (which i did). Now after saving my razor view it's having lots of extra empty comment lines through out the view. Which is causing a bit of issues with final Html. Here is how that empty comments looks like:
Has anyone face this issue before? If yes please kind enough to share solution. Given the time I have, i will manually remove these extra comments as of now and will look at it later when i have more luxury of time to spend on it. Thanks in advance.

ASP.NET is not displaying changes I do to code

In my web app I have a lot of gridviews and so on. Now I was trying to change some data format in the gridview, and the changes did not take effect when i debugged, either in Chrome nor Internet Explorer, it kept showing the same gridview as before. I tried to change the SQL data I was providing to it, and it actually changed, so the problem is when I'm altering in my web project.
Wondering what this could be, I did another test by removing the function that triggered when a button is pressed. When I debugged not only I did not get the error that usually comes with not assigning anything to a OnButtonClick but also when I pressed the button it did what it was doing before i removed the function.
Did this already happen to any of you?
Edit1. Now I tried to create an empty webform and when I debugged I get this error:
Error of analyzer
Description: Error parsing a resource required to make this request. See the
specific analysis error details below and modify your source file appropriately .
Are you hosting in IIS or debugging with Visual Studio's inbuilt server?
Try cleaning and rebuilding your code, then clearing your browser cache
Try deleting cache and cookies from (both of) your browsers.
Sometimes this gives problems when you are debugging because you will keep seeing previous parts of your current app.

Refresh html page using c# script

I have a HTML page in my project location and I am trying to populate values from my c# script to the place holder in HTML page. But every first time when i was running the script values got populated with correct details, but in the second run when i am changing my values like my name salary then HTML page doesn't reflect this new value and old data got appeared. Please suggest
Your question doesn't really explain much, in particular which technology your utilizing. It appears as if you lack an understanding of:
View State
Viable information can be found here. In an Web-Form application, you'll not only need to account for persistence of the View State, but the Page Life Cycle as well. It will play an important role in understanding the fundamentals.
You stated the following:
The first time the page loads the data exist, when I update the data
the old data exist rather than the new data.
Your issue could stem from either a Postback or the control your utilizing. When a Postback occurs, it means exactly what it states, a Client's interaction with your application transmits data back to the server.
You can remedy such a problem with:
Update Panel
Page.IsPostback
Databind();
Ajax
The problem has viable solutions, however until you truly understand the problem we can't specifically help you remedy the issue. This should point you in the proper direction though.

Categories

Resources