taskeenkayani / ext-direct-mvc

Automatically exported from code.google.com/p/ext-direct-mvc
0 stars 0 forks source link

Multiple action names error. Add a new attribute #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. When multiple actions are using the same name an error is thrown.
A banal example: AccountController contain these:
public ActionResult LogOn()
        {
            return View();
        }

        [HttpPost]
        public ActionResult LogOn(string ReturnUrl, string UserName, string
Password, string token, string sha1, bool? rememberMe)
        {
            JsonResult result;
            bool success = LoginUtil.Login(UserName, token, sha1, rememberMe,
this.ModelState, out result, ReturnUrl
                , FormsService, MembershipService);
            return result;
        }

What is the expected output? What do you see instead?
Method LogOn already exists in action Account. Please use a different name
or mark it with ActionNameAttribute.

I would expect an attribute to diferentiate these but not ActionName
for example DirectActionName("xx") would make my method callable as "xx"
from client side, but will actually map on one of the server side methods I
want.

What version of the product are you using? On what operating system?
1.0

Please provide any additional information below.

Original issue reported on code.google.com by alonec...@gmail.com on 20 Mar 2010 at 3:16

GoogleCodeExporter commented 8 years ago
I'm sorry, I don't understand. What is the problem with using 
ActionNameAttribute?

Original comment by elishnevsky on 16 Apr 2010 at 6:10

GoogleCodeExporter commented 8 years ago
I want to let the standard ActionName as it is i.e. both actions to be LogOn, 
but not
get an error from the ExtDirect.

Therefore I want another attribute DirectActionName, that would only affect the 
name
of the ExtDirect method and not of the actual action

Original comment by alonec...@gmail.com on 16 Apr 2010 at 7:07

GoogleCodeExporter commented 8 years ago
the first method, returns the view, so it is not Direct method anyway, so use 
attribute 
[DirectIgnore]

Original comment by HDne...@gmail.com on 26 Apr 2010 at 4:21

GoogleCodeExporter commented 8 years ago
If a controller inherits from another controller and override one of its action 
methods, then the "DirectAction_MethodExists" exception will also be thown out.

It seems that the error is caused in the DirectAction.ConfigureMethods.

Original comment by wenqiang.w on 3 Aug 2010 at 3:54