Here is image of the error and the code segment where it is erroring out.
Project was originally developed in VS2010 but was "upgraded" to VS2012 cause client has that dev environment. Not sure if there are other things i need to do after the upgrade that would resolve this problem or not.
This error only occurs when i place the Me.MaintainScrollPositionOnPostBack = True in Page_Load, Page Directive, or Web.Config. I have tried using self reference and Page reference and same problem.
If i remove the line of code Me.MaintainScrollPositionOnPostBack = True from any of the 3 locations the WebDev.WebServer#### runs the application fine.
Ultimate goals is that i have an undefined length object being loaded into a table. It could be as little as 5 items in the table or up to 100. In either case each item has a RadioButtonList object associated with it. Each RBL when clicked then submits the choice selected back to the SQL server and ultimately refreshes the page. This setting was suppose to fix the problem of the refresh, or PostBack, from resetting the scroll back to the top.
Found out after removing the MaintainScrollPositionOnPostBack property but adding in AJAX controls, i received similar errors.
Question:
Any suggestion on fixing this problem, so it wont occur in VS2010 or VS2012?
Is there an alternate approach so i can sustain the scroll position on the page while still submitting the RBL selected index change event to the SQL server?
How do i fix this so the JavaScript is either installed on my computer or WebServer instance from VS2010/2012 will use Javascript?
Seems this is related to Ajax registration within the web.config even though i have it registered in the project. Anyone know what declaration i need in web.config so ajax is run from the server and doesnt require client interaction? (FYI, .Net 4)
Related
I have a very strange error with an asp.net webform application which we deployed to a development server. Here are the strange behaviors.
After deploying, and using IE browser, I can see the new webpages with devexpress gridview. On my older code, the gridview rows were autogrouped by one of the columns, which was an error. I added code to trim the column value and it fixed the grid row autogrouping
Now, here is the strange error. When I redeployed again, some of the developers can view the page without any errors but others are seeing the gridview autogrouping. I deleted the client side cache and change the one of the gridview header literal and confirmed the page is the latest code but some of the user are still getting the gridview row autogrouping while some of us are not.
Other than clearing out the IE caching, I am not what else to do.
Any Idea of why this is happening.
Thanks
I have downloaded the latest toolkit from https://www.nuget.org/packages/AjaxControlToolkit/.
Problem is it works fine on my local host but not when i upload it to the server. I don't even get an error message. Simply anything Ajax related is not working. I'm suspecting that the installation I did is the problem, since it does everything automatically for me and in my project I can't add a ScriptManager since it keeps saying that I already have one in my system, eventhough I can't see in anywhere in my code.
Do anyone have any idea what the problem might be or what I'm missing?
You have a ScriptManager on the master page, and therefore when your child page gets composited with the master page there ends up being two script managers.
The normal solution is to only have the ScriptManager on the master page.
We have been trying to figure this one out for a while now, without any luck.
The symptoms are as follows:
After some idle time of a specific ASP.NET 2.0 application (can be from several hours to days), one of the pages in my application stops working.
When viewing the source of the page I see many elements missing, elements that are usually there, such as: reference to WebResource.axd, the __doPostBack() function, all of the UserControls and more.
A reference to ScriptResource.axd, and the __VIEWSTATE are there.
After recycling the app pool, the application starts working correctly again and everything renders well.
This only happens on a specific server, when deploying the same application on a different server, this error does not occur.
The page that the error occurs on has only one UserControl which is not rendered when the error occurs. Nothing special happens when this page is loaded.
We tried doing periodic client refreshes, but that did not help either.
Thanks in advance.
It was a caching issue. There was a part in the code that hid specific controls when the cache was invalid. That explains the missing code parts.
I am still not sure why the cache was invalid on that specific server.
I have an ASP.NET website that has been deployed since 2008 with plenty of users. From time to time, I've made updates to the site and uploaded those changes to the server without problems.
However, today, I'm trying to run the site on my development environment and I keep getting errors any time the code tries to access session state. It appears System.Web.HttpContext.Current.Session is always null!
Any suggestions on where to look? It's been a while since I worked on it and am not 100% sure if I've worked on it with the current version of ASP.NET (4.0).
Other than that, the code's been working fine and I haven't made any changes since it was last working.
More Information
I've spent all morning on this but I apparently have a larger issue.
If I step through the code, I see that my page Load handler executes. At this point, Session is not null. After that, my specialized master page executes. After that, my general master page executes. I then step through load events for a couple of controls. This all seems very normal.
Then, if I keep executing, suddenly I'm loading a specialized master page for another page and Session is now null!
If I hit F5, it the original page shows. But somehow it is causing the other page to load and without session state. If I turn off debug mode, it appears to run normally.
Obviously, I have something strange happening. I need to determine why the other page is being loaded.
Try to put a static page, something like Test.aspx and browse to that page. If it gets loaded, try to use Session property of the page in code behind. Do you still get the error? In that case, Session doesn't load. I suggest creating an HTTP Module and hooking into a method which is responsible for loading Session info. See what's wrong.
Just a guess - did you deactivate sessionState for any reason? Anything like this:
<sessionState mode="Off"/>
My apologies. The information I provided was completely misguided and was not sufficient to resolve the issue.
The problem was actually due to some custom error handling that redirected to an error page. This was configured in web.config. This error page was using the master page that my code was mysteriously executing.
Apparently, an error was occurring within the GridView control. This is ASP.NET code and not my own, so I was unable to step through it or catch it with a regular handler.
This was hard to understand. If I was executing the Load event handler of my error page, then it would've been obvious. But it appears to have skipped over that. Thus, my confusion.
Try checking the global.asax file or any other pre-load events and make sure the Session is not set to NULL explicitly.
Maybe your erring master page is calling code from some external class where the session object is not available?
We're having an issue with a .NET 3.5 WebForms site where occasionally our error logs start filling up with the following error message:
"Multiple controls with the same ID 'ctl09' were found. FindControl requires that controls have unique IDs."
I know very little about the exception as I have never seen it while debugging locally and have never caught it in the error logs soon enough to run a remote debugging session. I do know that an application pool recycle fixes the issue.
This only affects a single [high traffic] page in the site. The strange thing is that the site uses the pre-4.0 ID generation logic. So, when the page is working, there isn't an html element in the entire view source that isn't some autogenerated control ID prefix followed by a the 'actual' IDs (i.e. ctl09_someID_someOtherID).
So, 2 primary questions, though any ideas are welcome:
What would case a control to randomly stop being built correctly?
Other than the Global.asax, how can I trap this error and force the control to ... recompile? App pool to recycle?
I'm pretty much stumped.
Nothing as far as I'm aware, only an outside entity interferring with the page lifecycle or AJAX postback could potentially cause this, if each control is being generated, in turn, then you will not 'randomly' experience duplicate ids.
I don't think this is a viable option, app pool recycle? No way, there's got to be a valid reason for this.
Perhaps some more info/code would be useful? Is it a particular page? Are you using ViewState? There's lots of reasons for 'dodgy' control ids.