0

我目前配置了两条路线:


  ResourceSpace.Has.ResourcesOfType()
                  .AtUri("/patient")
                  .And
                  .AtUri("/patient/cardId/{cardId}")
                  .HandledBy()
                  .AsJsonDataContract()
                  .And
                  .RenderedByAspx("~/Views/Patient.aspx");


                ResourceSpace.Has.ResourcesOfType()
                    .AtUri("/product")
                    .And
                    .AtUri("/product/tagValue/{tagValue}")
                    .HandledBy()
                    .AsJsonDataContract()
                    .And
                    .RenderedByAspx("~/Views/Product.aspx");

使用此代码时


 using (scope(Xhtml.Form(Resource).ID("AddPatientForm").Method("post"))) { 

对于患者,它将动作转换为

行动=“/病人”

对于产品

动作="/product/tagValue"

我究竟做错了什么?我可以提示一下吗,我快速查看了源代码,Action 是一个 URI,所以我不能只通过 Action 设置它。

任何帮助,将不胜感激!

4

1 回答 1

0

对于患者,如果资源具有 cardId,则应首先选择该 URI。如果没有,那就是一个错误。

对于产品,这绝对是一个错误(除非您的产品类的 tagValue 为 null / empty),因此请在http://youtrack.codebetter.com/issues/OR上填写有关新错误跟踪器的错误报告

同时,如果设置了属性,您可以简单地执行 Xhtml.Form().Action(Resource.CreateUri()) 或 Xhtml.Form().Action(Resource.CreateUri(new{ car​​dId = value });

于 2010-07-28T09:48:55.253 回答