C# - ToolkitScriptManager Throws NullReferenceException During Concurrent Access To A Page For The First Time

May 14, 2010

i'm developing a ASP.NET web application which uses the AjaxControlkit 3.0.30512.20315. I have a ToolkitScriptManager instance on my master page which has some ScriptReferences in the CombineScripts collection. If i access my default page from 2 differenct clients after an iisreset, i get the following exception

[NullReferenceException: Object Reference not set to an instance of an object.]
System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +143
System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value) +11
AjaxControlToolkit.ToolkitScriptManager.GetScriptCombineAttributes(Assembly assembly) +129
AjaxControlToolkit.ToolkitScriptManager.IsScriptCombinable(ScriptEntry scriptEntry) +148
AjaxControlToolkit.ToolkitScriptManager.OnResolveScriptReference(ScriptReferenceEventArgs e) +415
System.Web.UI.ScriptManager.RegisterScripts() +191
System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +113
System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +8698462
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1029

Using .NET Reflector i found out that the GetScriptCombineAttributesmethod access a static dictionary, which is not protected against concurrent access. Either i have a race condition in my code or there is a bug in the AjaxToolkit.

View 2 Replies


Similar Messages:

AJAX :: AjaxControlToolkit.ToolKitScriptManager.OnInit() Throws Thread Abort Exception For Every Aspx Page

Nov 3, 2010

AjaxControlToolkit.ToolKitScriptManager.OnInit() throws thread abort exception for every aspx page. I have an asp.net 2.0 Ajax application, where I have set the following properties of ToolScriptManager on my pages.

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnableScriptGlobalization="true"
EnableScriptLocalization="true" CombineScripts="true" EnablePageMethods="true">
<Scripts>

I have this configuration on all the aspx pages in my application. When I checked the .NET CLR exception Performance counter I figured out a large number of exceptions, mainly one exception per page load is occuring. On running windbg I was noticed that

AjaxControlToolkit.ToolKitScriptManager.OnInit() has the following code block which is getting executed. The OutputCombinedScriptFile() returns true. But since I am setting my controls on DesignTime still designmode is set to false for toolkitscriptmanager.

if (!DesignMode && (null != Context) && OutputCombinedScriptFile(Context))
{
// This was a combined script request that was satisfied; end all processing now
Page.Response.End();
}

I am not sure if this is a reported bug or even a bug with ajax, but this is causing havoc in my load test results as I have around 3 hundred thousand HTTP requests to be handled per day out of which 80% are aspx page requests resulting in a large number of threadafbortexceptions, thus affecting the performance.

View 3 Replies

MVC :: TryUpdateModel Throws NullReferenceException In 3 Unit Test

Nov 12, 2010

Since I upgraded from MVC 2 to MVC 3 RC, using TryUpdateModel causes a NullReferenceException. This problem only occurs when running my action method as part of a unit test. Running it on the actual server works as expected. Here's a stack trace of the exception:

System.NullReferenceException: Object reference not set to an instance of an object. at System.Web.Mvc.JsonValueProviderFactory.GetValueProvider(ControllerContext controllerContext) at System.Web.Mvc.ValueProviderFactoryCollection.<>c_DisplayClassc.b_7(ValueProviderFactory
factory) at System.Linq.Enumerable.WhereSelectEnumerableIterator[Code]....
2.MoveNext()
at
System.Collections.Generic.List[Code]....
1
collection) at
System.Linq.Enumerable.ToList[TSource](IEnumerable`1
source) at
System.Web.Mvc.ValueProviderFactoryCollection.GetValueProvider(ControllerContext
controllerContext) at
System.Web.Mvc.Controller.TryUpdateModel[TModel](TModel
model, String prefix)
... my own code from here on....

In case it matters, my controller has the following signature:

[Code]....

My guess is that this has to do with the new way DI works in MVC3, but I can't figure out what I'm doing wrong. Perhaps there is something in terms of DI setup that is required in MVC 3, but wasn't required in MVC 2?

View 6 Replies

Crystal Reports :: CrystalReportViewer.ReuseParameterValuesOnRefresh Throws NullReferenceException

Feb 10, 2010

I am installing a website that uses CrystalReport to display reports on a customer's server. When trying to display a report I got an error at the following line:

<CR:CrystalReportViewer runat="server" AutoDataBind="True" EnableDatabaseLogonPrompt="False" EnableParameterPrompt="False" ReuseParameterValuesOnRefresh="True" DisplayGroupTree="False" .... />Error:
[NullReferenceException: Object reference not set to an instance of an object.]
CrystalDecisions.Web.CrystalReportViewerBase.set_ReuseParameterValuesOnRefresh(Boolean value) +28
ASP.memberpages_MyPage_aspx.__BuildControlCrystalReportVPI() in d:Web_apldomainMemberPagesMyPage.aspx:10
ASP.memberpages_MyPage_aspx.__BuildControlshow_filter() in d:Web_apldomainMemberPagesMyPage.aspx:9
ASP.memberpages_MyPage_aspx.__BuildControlContent(Control __ctrl) in d:Web_apldomainMemberPagesMyPage.aspx:8
System.Web.UI.CompiledTemplateBuilder.InstantiateIn(Control container) +12
ASP.memberpages_sitetemplate_master.__BuildControlSiteTemplate_Content() in d:Web_apldomainMemberPagesSiteTemplate.master:90
ASP.memberpages_sitetemplate_master.__BuildControlSiteTemplateForm() in d:Web_apldomainMemberPagesSiteTemplate.master:39
ASP.memberpages_sitetemplate_master.__BuildControlTree(memberpages_sitetemplate_master __ctrl) in d:Web_apldomainMemberPagesSiteTemplate.master:1
ASP.memberpages_sitetemplate_master.FrameworkInitialize() in d:Web_apldomainMemberPagesSiteTemplate.master.cs:912307
System.Web.UI.UserControl.InitializeAsUserControlInternal() +31
System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +1978576
System.Web.UI.Page.get_Master() +48
System.Web.UI.Page.ApplyMasterPage() +18
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +543
I tried to set the same attributers programmatically in the Page_Load event:
protected void Page_PreInit(object sender, EventArgs e)
{
CrystalReportVPI.AutoDataBind = true;
CrystalReportVPI.EnableDatabaseLogonPrompt = false;
CrystalReportVPI.EnableParameterPrompt = false;
CrystalReportVPI.ReuseParameterValuesOnRefresh = true;
...
}

Here the NullReferenceException is thrown only in the »CrystalReportVPI.ReuseParameterValuesOnRefresh = true;« line. The same page runs on another customer's server with no errors. The server's environment is: Windows Server 2000 CRRedist2005_x86.msi dotnetfx.exe 2.0.50727.42 Has anyone encountered problems like this? Any idea how to solve it? I already searched for answers on different forums with no result.

View 1 Replies

Concurrency - SqlConnection Already Open In Case Of Concurrent Access To Same Page

Dec 29, 2010

I have a strange problem in my ASP.Net 3.5 application. When multiple users try to access the same page (which has some long running methods), the application crashes at a point where it tries to open a connection to the database (a static method inside a static class). It appears that the connection is already open. However, this does not happen when there is only one user using the application. What I cannot understand is that how do actions of one user affect the other in a web application?

I double checked that all my open connections are being closed after performing their operation by appending a line of text to a text file whenever a connection is opened or closed. The number of opened and closed connections was equal. Also, the connections are opened and closed from one place only, where the close method is inside a Finally() block.

View 1 Replies

C# - Access Session Value During Concurrent Requests

Mar 9, 2010

in one request i am updating session variable. in the other request, i am trying to access that session value, but it was blocked until the first request finish. I am using C# with ASP.NET 2.0 UPDATE: My page code looks like this.

while(int progress = DoWork() && progress <= 100 ){
Session["Progress"] = progress;
}

and my handler just return Session value.

context.Response.Write(Session["progress"].toString());
context.Response.End();

View 1 Replies

Web Forms :: Concurrent User Access In An ASP Application

Oct 21, 2010

If multiple users access a web-form at the same time, how can I allow that using my code? Essentially each user reads and writes one variable in the application, and concurrent access is causing problem there.

View 5 Replies

Cache Access In Highly Concurrent Systems

Nov 16, 2010

Suppose I have two threads(Thread1, Thread2) where the threads are accessing the cache for a given object such as in the code below nearly at the same time:

Dim expensiveToGetData = Cache("ExpensiveDataKey")
If ExpensiveToGetData is nothing then
'because the cache has expired
ExpensiveToGetData = LoadExpensiveDataFromDataSource()
Cache("ExpensiveDataKey") = ExpensiveToGetData
end If
ProcessExpensiveData(ExpensiveToGetData)

Isn't it possible for both threads to load the cache because they both requested data from the cache that was nothing/expired? I've run some tests on a local machine and it seems that the cache is being loaded more than once. Is this a normal pattern?

View 2 Replies

State Management :: Concurrent Access To Session Object

Mar 30, 2010

I am stuck with the issue of concurrent access to Session object. Actually my problem is i m writing to session in frame1 and trying to access that same Session object at the same time in Frame2's Page. I know about the reader/writer lock. I made the enablesessionstate = readonly in the page where i m writing to session. its giving me strange behavior on IE and firefox.

Its working concurrently in IE8 ( means page2 is diplaying modified values while page1 is changing the session object) but does not work in Firefox even page load is not called untill function on page 1 completed. Either anyone can fix my issue with firefox or there is new solution to reader/writer lock so that i can read the session at the same time while writing.

View 2 Replies

C# - SQlite / Firebird - Support Multiple Concurrent Write Access?

May 19, 2010

I currently store ASP.net application data in XML files. Now the problem is I have asynchronous operations, which means I ran into the problem of simultanous write access on a XML file... Now, I'm considering moving to an embedded database to solve the issue. I'm currently considering SQlite and embeddable Firebird. I'm not sure however if SQlite or Firebird can handle multiple concurrent write access. And I certainly don't want the same problem again. Anybody knows? SQlite certainly is better known, but which one is better - SQlite or Firebird ? I tend to say Firebird, but I don't really know. No MS-Access or MS-SQL-express recommodations please, I'm a sane person.

View 5 Replies

AJAX :: TabControl Inside FormView Throws Error In Design Time

Dec 9, 2010

I'm trying to use a Tab control with 5 tabs inside a form view, when I view my aspx page in Visual Studio 2008 it displays a error message stating "There was an error rendering the control. Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "AjaxControlToolkit.properties.Resources.resources" was coreectly embedded or linked into assembly ... " running the site just shows a blank page (as the control isn't rendered).

If I remove the tab control from within the ItemTemplate (or EditItemTemplate) and put it directly onto the page it works fine. Googling for the error suggests the references aren't correct, so I've reset the toolbox, and re-added the reference - this time referencing the file in my Bin folder (not the installation path of the Ajax Toolkit). Still it throws the same error. Finally I've stripped the code out into a page with the bare minimum (no code behind) and it still throws the same error. I'm sure I had this working previously. I'm using Visual Studio 2008 on Windows 7 and I'm using the 3.5 files from Codeplex (AjaxControlToolkit.Binary.NET35.zip) targetting .NET Framework 3.5.

View 2 Replies

Security :: AzMan Throws Access Is Denied On Win2008 Server From Website

Mar 22, 2010

We have been using AzMan in development and all was going well until we tried using it our QA website (Windows 2008 Enterprise SP2) and I get: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Web.Security.AuthorizationStoreRoleProvider.CallMethod(Object objectToCallOn, String methodName, Object[] args)
at System.Web.Security.AuthorizationStoreRoleProvider.GetClientContext(String userName)
at System.Web.Security.AuthorizationStoreRoleProvider.GetRolesForUserCore(String username)
at System.Web.Security.AuthorizationStoreRoleProvider.GetRolesForUser(String username)
at OurApp.login.ValidateAgainstSpecificADProvider(ActiveDirectoryMembershipProvider provider)
at OurApp.login.AutoValidateForAllADProviders()
at OurApp.login.Btn_Login_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

This is when the call to GetRolesForUser(username) is made to the AuthorizationStoreRoleProvider. The website is running under it's own machine service account and when I look at the Security tab in AzMan.msc I can see the service account has Administrator access to the store. I've tried adding to the Reader rights but this doesn't do anything.

This error has not shown up in development on Windows 7 Workstation and interestingly the local store was created in the same way from the website code, so the website service account has full access. I've checked file permissions and played around with the security settings in AzMan.msc and I cannot get it going. At one stage the error changed to "Invalid Handle". There is nothing in the event log so it's very tough to troubleshoot an obscure COM error like this. I guess it could be anything! :)

I also tried impersonating a domain account for the call based on some other posts I read on the net but this didn't work for me. The other interesting thing to note is that the website creates the store (first time) and it actually mnages to create the store without any problems at all. It's just this call to GetRolesForUser that blows out.

View 3 Replies

AJAX :: How To Use ScriptManager And ToolKitScriptManager In Same Web Page

May 7, 2015

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

I am using this with update panel it works fine.

Now i have added modal popup. Used ajax 15.1 toolkit. they said it doesnt require ajax script manager now.)

When i use it without ajaxscript manager  it doesnt work. But when i use ajaxscript manager it works. But then i cant use scriptmanager (as two instance cant run).If i dont use script manager update panel wont work. Also i dont dont have any master page.

<cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panel1" TargetControlID="btnShow"
CancelControlID="btnClose" BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
<cc1:ToolkitScriptManager ID="tksc" runat="server"></cc1:ToolkitScriptManager>

View 1 Replies

AJAX :: NullreferenceException With Fied Webusercontrol And .aspx Page?

May 13, 2010

I have written a basic ASP.NET user control. It looks like this:

<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
</asp:ScriptManagerProxy>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" >

[code]...

View 1 Replies

SQL Server :: Concurrent Access In SQL Server 2005

Mar 7, 2011

I have a .net web application (framework 2.o) and SQL Server 2005 as my backend. I need to design an application which fetches a particular unique pin number to a customer and then mark this record as used. The problem I face is as the no of concurrent users are more , same pin number is getting allotted to multiple users.

View 3 Replies

AJAX :: Changed From ScriptManager To ToolkitScriptManager / Now Error Moving From Default Page?

May 20, 2010

I am hoping I am in the right place for this, I have a web application which has been running for about 4 years recently I updated my Ajax to the most recent version it continued to work OK then I changed from ScriptManager to ToolkitScriptManager now I get an error moving from my default page

View 1 Replies

MVC Custom Error Page (StatusCode 404 Throws A 500)?

Mar 3, 2010

I've got customErrors set in my web.config

XML Code:

<customErrors mode="On" defaultRedirect="/Error/GeneralError">
<error statusCode="404" redirect="/Error/NotFound"/>
</customErrors>

This works fine locally. A 404 throws a 404. On the shared hosting it throws up the standard server 404 page unless I specifically set 404 to point to /Error/NotFound. That's fine. Now it will show the custom 404 page except the response status code is 200. So if I try to throw Response.StatusCode = 404; in my NotFound action in ErrorController like this:

Csharp Code:

[code]....

the server throws a status code 500 Internal Server Error but my GeneralError page doesn't show, just a blank white page with no source.

I've tried many different combinations but I can't seem to find how to make it show my custom 404 page along with a 404 response.

View 11 Replies

Configuration :: Page Using Validation Throws WebResource.axd Error

Mar 3, 2011

I have a simple textbox and button on a page using validation, like so:

<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" ValidationGroup="TestV" Text="Button" />
<asp:RequiredFieldValidator ControlToValidate="TextBox1" ID="RequiredFieldValidator1" ValidationGroup="TestV" runat="server" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
</div>
</form>
</body>
[code]...

View 1 Replies

Page Throws ViewState Error When Items Collection Of Dropdownlist Is Modified In IndexChanged Event

Feb 25, 2011

I have an ASCX control which is a special dropdownlist. I add that control dynamically to the page and fill it with data. This control has a postback that will change the contents of a second dynamically created standard dropdownlist.

When I change the selection on the first dropdown, the indexchanged fires and I get new data and attempt to place it in the second dropdownlist's items collection, by first clearing it then filling it with new data.

This works fine the first time a change the selection, but when I select a second time the following error is thrown:

The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.

I'm not adding or removing new controls in the fired event, only changing data. And again, it works the first time, but doesn't subsequent times.

If I disable stateview on the child control, then the control just doesn't get updated with data at all.

View 1 Replies

Configuration :: 2.0 Site On IIS 6 - Loads Super Slow And Sometimes Throws "Page Not Found" On Post Back?

Jan 24, 2011

Looking for advice on how to troubleshoot an application (not something I wrote) that is on the old 2.0 Framework. It acts "crazy" sometimes when selecting an item from a drop down list. Sometimes the page will reload like it should on the post back with the new data, while othertimes, it just throws a Page Not Found error. What's the best way to troubleshoot and eliminate the various variables of IIS6, 2.0 Framework, SQL Server, the VirtualMachine, etc.

View 3 Replies

AJAX :: Error On First Time Page Refresh Then Removes On The Second Time / Could Not Load File Or Assembly

May 20, 2010

Server Error in '/MedTegraSL.Web' Application.

Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

Description:

An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

Source Error:

[Code]....

Source File:

c:ProductiveTeamsMedTegraPresentationMedTegraSLMedTegraSL.WebMainMaster.Master Line: 16 Assembly Load Trace: The following information can be to determine why the assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' could not be loaded.

[Code]....

Stack Trace:

[Code]....

View 2 Replies

AJAX :: Collapsiblepanelextender - Each Time The Page Opens Or Postsback The Panels Open For A Time And Then Close

May 20, 2010

I have a series of collapsible panel extenders on my page and each time the page opens or postsback the panels open for a time and then close. Is there a way to prevent this?

View 4 Replies

Crystal Reports :: Each And Every Page Loading Time And Where Actually It Take Long Time?

Nov 22, 2010

I have developed an application in asp.net with crystal report. It has more than 30 pages in the project. Now I want to improve the performance of the application.1. What I need is , I want to know each and every page loading time and where actually it take long time to load while requesting the page.There are so many tools available. But am not able to follow as where actually the problem is and how to solve.

View 6 Replies

Page_Load Events Executed Every Time A Page Was Loaded Not Just The First Time?

Aug 5, 2010

I thought that Page_Load events executed every time a page was loaded not just the first time. Am I wrong on this?

I have a Page_Load event that writes text to a label to display on the screen: Output.Text &= "Welcome to my Website <br />" (Output being the ID of a Label control)

I also have an On_Click event for a button to display the same information: Output.Text &= "Welcome to my Website <br />"

After clicking the button, I expected to see the output twice. Once for the page being reloaded and once for the click event. I thought that Page_Load events executed every time a page was loaded not just the first time.

View 3 Replies

Visual Studio 2010 - Site Upgraded VS08 - VS10, And Now Compile-time Errors Do Not Show Until I Request The Page At Run-time?

Mar 11, 2011

I have an ASP.NET website that worked fine using and debugging in VS2008. I went through the upgrade process opening the solution in VS2010. I can run the site, but as I make changes in the app_code folder classes, they don't seem to commpile and warn me of compile-time errors. As soon as I get to a point that calls the class, the errors show up. Sounds JIT I guess, but this isn't how it was working in 08. Is there an option that was changed in the upgrade process? This is a large project, I really don't want to break something and not find out until some obscure page is opened.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved