PDA

View Full Version : [CLOSED] Illegal characters in path. - Razor view



MTSI
Oct 08, 2012, 3:38 PM
Hi,

I am facing one critical bug unable to proceed further.




@using Ext.Net.MVC
<!DOCTYPE html>
<html>
<head>
@Html.X().ResourcePlaceHolder(Ext.Net.ResourceMode .ScriptFiles)
<script type="text/javascript" src="@Url.Content("~/scripts/json2.js")" ></script>
<script src="@Url.Content("~/Scripts/jquery-1.5.1.js")" type="text/javascript"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/extTab.js")"></script>
</head>
<body>
<div>
@Html.X().ResourceManager()
@RenderBody()
<iframe frameborder="0" height="0" width="0" scrolling="no" src="@Url.Content("~/Home/GetAlerts")">
</iframe>

</div>
</body>
</html>






@using Ext.Net
@using Ext.Net.MVC
@using Merrill.Mll.UI.Component.Shared
@using Merrill.Mll.Domain
@{
Layout = "~/Views/Shared/_ExtLayoutOther.cshtml";
string JobsId = ViewBag.JobsId != null && !string.IsNullOrEmpty(ViewBag.JobsId) ? ViewBag.JobsId : string.Empty;

Ext.Net.Panel jobinformationpanel = new Ext.Net.Panel();
jobinformationpanel.ID = "JobPanel";
jobinformationpanel.Title = "Job Information";
jobinformationpanel.Loader = new Ext.Net.ComponentLoader() { ID = "CustomerPanel", Url = Url.Content("~/Job/EditBillingJobInfo/" + JobsId), AutoLoad = true, Mode = Ext.Net.LoadMode.Frame };
jobinformationpanel.Loader.LoadMask.ShowMask = true;
jobinformationpanel.Loader.LoadMask.Msg = "Loading job Information...";

Ext.Net.Panel orderpanel = new Ext.Net.Panel();
orderpanel.ID = "OrderPanel";
orderpanel.Title = "Order";
orderpanel.Loader = new Ext.Net.ComponentLoader() { ID = "OrderPanel", Url = Url.Content("~/Job/ListOrders/" + JobsId), AutoLoad = true, Mode = Ext.Net.LoadMode.Frame };
orderpanel.Loader.LoadMask.ShowMask = true;
orderpanel.Loader.LoadMask.Msg = "Loading order Information...";
}
@(Html.X().Viewport()
.Layout("billingborder").Items(port =>
{
port.Add(
Html.X()
.TabPanel()
.ID("billingMasterPanel")
.Border(false)
.SetLoading(new LoadMask { ShowMask = false })
.Region(Ext.Net.Region.Center)
.Items(panel =>
{
panel.Add(
jobinformationpanel
);
panel.Add(
orderpanel
);
})
);
}))



Exception:

Message : Illegal characters in path.
Source : mscorlib
TargetSite : Void CheckInvalidPathChars(System.String)

Gettting exception in this part



@(Html.X().Viewport()
.Layout("billingborder").Items(port =>
{
port.Add(
Html.X()
.TabPanel()
.ID("billingMasterPanel")
.Border(false)
.SetLoading(new LoadMask { ShowMask = false })
.Region(Ext.Net.Region.Center)
.Items(panel =>
{
panel.Add(
jobinformationpanel
);
panel.Add(
orderpanel
);
})
);
}))


Thanks in advance

Vladimir
Oct 08, 2012, 4:03 PM
Why do you think that it is Ext.Net bug? I guess that set incorrect path therefore ASP.NET MVC raises an exception

What exactly path raises an exception? What kind of invalid characters are presented in the path? What value are palced in JobsId?
I tried to reproduce the issue with your code but no errors on my side

Please investigate the following article
http://www.hanselman.com/blog/ExperimentsInWackinessAllowingPercentsAnglebracket sAndOtherNaughtyThingsInTheASPNETIISRequestURL.asp x

MTSI
Oct 08, 2012, 4:40 PM
Why do you think that it is Ext.Net bug? I guess that set incorrect path therefore ASP.NET MVC raises an exception

What exactly path raises an exception? What kind of invalid characters are presented in the path? What value are palced in JobsId?
I tried to reproduce the issue with your code but no errors on my side

Please investigate the following article
http://www.hanselman.com/blog/ExperimentsInWackinessAllowingPercentsAnglebracket sAndOtherNaughtyThingsInTheASPNETIISRequestURL.asp x

I investigated the problem as per your view but there is no problem in url. Below i mentioned detailed exception. Please take a look at it.

at System.IO.Path.CheckInvalidPathChars(String path)
at System.Security.Permissions.FileIOPermission.HasIl legalCharacters(String[] str)
at System.Security.Permissions.FileIOPermission.AddPa thList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission.AddPa thList(FileIOPermissionAccess access, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor (FileIOPermissionAccess access, String path)
at System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
at Ext.Net.BaseControl.SelfRender()
at Ext.Net.BaseControl.Builder`2.ToHtmlString()
at System.Web.WebPages.WebPageExecutingBase.WriteTo(T extWriter writer, Object content)
at ASP._Page_Views_Job_EditBilling_cshtml.Execute() in d:\MLL QA\Merrill.Mll.WebSite\Views\Job\EditBilling.cshtm l:line 26
at System.Web.WebPages.WebPageBase.ExecutePageHierarc hy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.StartPage.ExecutePageHierarchy ()
at System.Web.WebPages.WebPageBase.ExecutePageHierarc hy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.Mvc.ViewResultBase.ExecuteResult(Contro llerContext context)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19()
at System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)


Thanks in advance.

Vladimir
Oct 08, 2012, 4:50 PM
Can you create a simple sample which doesn't require any changes from our side and reproduces the issue?
Please remove all unrelated to the issue code, like attaching jquery resources and etc

MTSI
Oct 09, 2012, 6:36 AM
Can you create a simple sample which doesn't require any changes from our side and reproduces the issue?
Please remove all unrelated to the issue code, like attaching jquery resources and etc

Hi,

It is due to URL encryption it should be fixed in our side only not in EXT.NET.

Thanks for your support.