Developer forum

Forum » Development » RE: Ajax Partial Post Backs.

RE: Ajax Partial Post Backs.

Yasharth Tahiliani
Reply

Hi guys, 

Do we know why I am unable to implement partial page post backs using a AJAX Update Panel in a Dynamic Web solution?

I have made sure that I have implemented everything correctly, also made sure that the functionality works fine on another page outside Dynamic Web. 

However, as soon as I use it in my DW solution, it will not let me do partial postbacks and the page errors. I am attaching a copy of the User Control .ascx file, and a screen shot of the error that I receive.

Look forward to hearing on this.

Yash.

AJAXError.jpg

Replies

 
Yasharth Tahiliani
Reply

Looking at the Application Logs in the Event Viewer of the server, I see the following message:

 

3005 
   An unhandled exception has occurred. 
   14/08/2015 11:01:37 
   14/08/2015 10:01:37 
   d0ac5c06fd45411e90906b8c86b9a878 
   139 
   6 
   0 
   /LM/W3SVC/1/ROOT-1-130840186070182016 
   Full 
   / 
   C:\Dynamicweb.net\Application(8.6.11)\ 
   NSTWEBUAT 
    
   2896 
   w3wp.exe 
   NT AUTHORITY\NETWORK SERVICE 
   NullReferenceException 
   Object reference not set to an instance of an object. at Dynamicweb.Database.SqlInjectionPrevent() at Dynamicweb.Frontend.GlobalAsaxHandler.Application_OnPreRequestHandlerExecute(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)  
   http://nstwebuat.int.rroom.net/Default.aspx?ID=130 
   /Default.aspx 
   10.15.100.145 
   NSTWEBUAT\nstwebadmin 
   True 
   Basic 
   NT AUTHORITY\NETWORK SERVICE 
   24 
   NT AUTHORITY\NETWORK SERVICE 
   False 
   at Dynamicweb.Database.SqlInjectionPrevent() at Dynamicweb.Frontend.GlobalAsaxHandler.Application_OnPreRequestHandlerExecute(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)  

 

I tried disabling SQL Injection Check in the Security section of the CMS, but that does not change anything too.

 

Looking forward to your assistance on this!

 

Yash.

 
Nicolai Høeg Pedersen
Reply

My guess from the exception is that the ajax request you are requesting does not have a HTTP context, and it contains something from Dynamicweb that requires a http context.

That said - I recommend you to not use .ascx and AJAX Update Panel at all in the frontend. There are so many better and more modern options where you can actually control what happens...

BR Nicolai

 
Yasharth Tahiliani
Reply

Ok, so are you suggesting something like handling these things with Javascript?

Regards,

Yash.

 
Nicolai Høeg Pedersen
Reply

Yes, an ajax panel is also Javascript. But wrapped in asp.net controls.

Using i.e. JQuery directly is much more lean and it is easy to create ajax based responses from Dynamicweb.

 
Yasharth Tahiliani
Reply

Ok, thanks for the advice Nicolai, much appreciated! 

Regards.

 

You must be logged in to post in the forum