PDA

View Full Version : [CLOSED] [Razor] PartialViewResult Exception



Timothy
May 16, 2012, 7:45 PM
Hello,

I'm receiving the following exception when using the PartialViewResult after checking out a fresh copy from SVN.

Any suggestions? Let me know if you need more information, I haven't had time to investigate which control is throwing the issue.

Cheers,





Server Error in '/' Application.
--------------------------------------------------------------------------------




ItemTag validation (_tkn_13): Reference token (ext.net.global.script.before) was not found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.


Exception Details: System.Exception: ItemTag validation (_tkn_13): Reference token (ext.net.global.script.before) was not found.


Source Error:










Line 89: new public static string Transform(string text)
Line 90: {
Line 91: return new ExtNetTransformer(ExtNetTransformer.PrepareText(te xt)).Transform();
Line 92: }
Line 93:


Source File: D:\ ... \Ext.NET\Source\Ext.Net\Core\ExtNetTransformer.cs Line: 91


Stack Trace:










[Exception: ItemTag validation (_tkn_13): Reference token (ext.net.global.script.before) was not found.]
Transformer.NET.ItemTag.Validate() +212
Transformer.NET.TextTransformer.Handle() +299
Transformer.NET.TextTransformer.Transform(List`1 tokensType, Dictionary`2 variables) +35
Ext.Net.ExtNetTransformer.Transform(String text) in D:\ ... \Ext.NET\Source\Ext.Net\Core\ExtNetTransformer.cs: 91
Ext.Net.MVC.PartialViewResult.RenderRazorView(Cont rollerContext context, RazorView razorView) in D:\ ... \Ext.NET\Source\Ext.Net\MVC\PartialViewResult.cs:3 28
Ext.Net.MVC.PartialViewResult.ExecuteResult(Contro llerContext context) in D:\ ... \Ext.NET\Source\Ext.Net\MVC\PartialViewResult.cs:1 70
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +33
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +825460
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +265
System.Web.Mvc.ControllerActionInvoker.InvokeActio n(ControllerContext controllerContext, String actionName) +825488
System.Web.Mvc.Controller.ExecuteCore() +159
System.Web.Mvc.ControllerBase.Execute(RequestConte xt requestContext) +335
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +54
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute() +469
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +375





--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

Vladimir
May 16, 2012, 9:47 PM
Thank you for the report. Fixed in SVN

Timothy
May 17, 2012, 3:18 PM
Confirmed, thank you.

Cheers,
Timothy

Timothy
May 31, 2012, 12:55 PM
Hello,

I'm receiving this error again after updating SVN.

Cheers,
Timothy

Vladimir
May 31, 2012, 1:01 PM
Hi,

Sorry, I cannot reproduce the issue on my test case. Can you post your test case?

Timothy
May 31, 2012, 1:06 PM
I'll have to work on a test case, this is in my larger program.

Here is the actual exception:


Server Error in '/' Application.
ItemTag validation (_tkn_1): Reference token (init_script) was not found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.


Exception Details: System.Exception: ItemTag validation (_tkn_1): Reference token (init_script) was not found.


Source Error:


Line 89: new public static string Transform(string text)
Line 90: {
Line 91: return new ExtNetTransformer(ExtNetTransformer.PrepareText(te xt)).Transform();
Line 92: }
Line 93:




Source File: D:\Application\Library\Required Dependencies\Ext.NET\Source\Ext.Net\Core\ExtNetTra nsformer.cs Line: 91


Stack Trace:


[Exception: ItemTag validation (_tkn_1): Reference token (init_script) was not found.]
Transformer.NET.ItemTag.Validate() +212
Transformer.NET.TextTransformer.Handle() +299
Transformer.NET.TextTransformer.Transform(List`1 tokensType, Dictionary`2 variables) +35
Ext.Net.ExtNetTransformer.Transform(String text) in D:\Application\Library\Required Dependencies\Ext.NET\Source\Ext.Net\Core\ExtNetTra nsformer.cs:91
Ext.Net.InitScriptFilter.Transform() in D:\Application\Library\Required Dependencies\Ext.NET\Source\Ext.Net\Core\InitScrip tFilter.cs:70
Ext.Net.InitScriptFilter.Flush() in D:\Application\Library\Required Dependencies\Ext.NET\Source\Ext.Net\Core\InitScrip tFilter.cs:57
System.Web.HttpWriter.Filter(Boolean finalFiltering) +398
System.Web.HttpResponse.FilterOutput() +141
System.Web.CallFilterExecutionStep.System.Web.Http Application.IExecutionStep.Execute() +168
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +270




Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272


Sorry I just noticed the exception is a little different then the original.

Cheers,
Timothy

adelaney
May 31, 2012, 1:16 PM
I was receiving this error as well during an Ajax postback (e.g. Ajax.BeginForm(....) when I was using the the AjaxOptions to replace the contents of my page. However, I thought I was doing something wrong with the Ajax and reverted back to a regular form and no longer have a detailed example for you. Sorry. Still, hopefully, this is enough for you to create a quick test case.

Vladimir
May 31, 2012, 1:24 PM
Can you post the text is passed to Transform method? May be it will give us ideas how to reproduce the issue

adelaney
May 31, 2012, 1:33 PM
Like I stated, I have deleted the code as I thought I had the Ajax incorrect. However, the best I can give you is this:


@Using Ajax.BeginForm(actionName:="results", routeValues:=Nothing, ajaxOptions:=New System.Web.Mvc.Ajax.AjaxOptions() With {.HttpMethod = "Post", .OnBegin = "BeginFunction", .OnSuccess = "SuccessFunction", .OnFailure = "FailedFunction", .InsertionMode = InsertionMode.Replace, .UpdateTargetId = "div1"})
End Using

Timothy
May 31, 2012, 3:16 PM
OK, I was able to replicate and it turns out the problem was that my action was returning a view and not a Ext.Net.MVC.PartialViewResult :(

Disregard my report.

Thanks vladsch, and sorry to waste your time again!

Cheers

Vladimir
May 31, 2012, 3:18 PM
No problem, thanks for update