@elishnvsky - Very nice, thank you!
I got this error too![]()
Code:public ActionResult Index() { var response = new { totalCount = 20, root = new object[]{ new { Name = "Client 1" }, new { Name = "Client 2" }, new { Name = "Client 3" }, } }; return this.Direct(response); }
P.S.: this asp.net mvc ext direct implementation is awesome!
hi,
how to register my controller to the api....
i did everything same like on the MVC Solution, but on the Demo i get
on my own project for the same comeCode:<script type="text/javascript" src="<% = Url.Content("~/Direct/Api") %>"></script> Ext.app.REMOTING_API={ "url": "/Direct/Router", "type": "remoting", "actions": { "Test": [ { "name": "SayHello", "len": 0 }, { "name": "EchoDate", "len": 1 }, { "name": "AddNumbers",
How to register TestController to the API?Code:<script type="text/javascript" src="<% = Url.Content("~/Direct/Api") %>"></script> Ext.app.REMOTING_API={ "url": "/Direct/Router", "type": "remoting", "actions": { "Direct": [ { "name": "Api", "len": 0 }, { "name": "Router", "len": 0 } ] } }; Error: Test is not defined
Webconfig:
<configSections>
<section name="ext.direct" type="Ext.Direct.Mvc.Configuration.DirectSection, Ext.Direct.Mvc"/>
</configSections>
<ext.direct providerName="Ext.app.REMOTING_API" assembly="Ext.Direct.Mvc" dateFormat="Iso" debug="true"/>
<configSections>
<section name="ext.direct" type="Ext.Direct.Mvc.Configuration.DirectSection, Ext.Direct.Mvc"/>
</configSections>
<ext.direct providerName="Ext.app.REMOTING_API" assembly="Ext.Direct.Mvc" dateFormat="Iso" debug="true"/>[/QUOTE]
assembly="Ext.Direct.Mvc" should be assembly="Your.Controllers.Assembly"
Hi all,
I've some problems to make the configuration works. I have a web project and another controller project in my solution. I read the tutorial and configure my web.config as it should be. My problem is when I try to add the provider under Ext.onReady function, I get an error like :
'events' is Null or not an objetThis is coming from the addProvider method of the ext-all file. I think ext is not encountering the assembly of my controller project (I checked all the names dozen of times) cause the provider parameter of the addProvider method is received undefined...
I have downloaded the test project available with Ext.Direct.Mvc and it runs well. Actually, I'm sure the problem is the assembly because putting a wrong name in the web.config of the demo solution cause the same issue. But I'm sure I have my assembly name correct....
Any suggestion would be appreciated![]()
Getting ready to jump into MVC and Direct for the first time as I think the pattern is pretty cool and here to stay, especially since ExtJS (err Sencha) apps don't really use ASP.net controls or the Server Page Event model. Will this implementation of Ext.Direct for ASP.NET MVC work fine with the new ASP.NET MVC 3, or are they any breaking changes or gotchas? From my understanding, most of the new stuff is related to Views which I wouldn't use anyway, but always nice to start with the latest. The JSON binding improvements seem nice though.
Suggestions, comments appreciated!
Thanks...
No problems using this with MVC 2 and 3.
I only have one view in my projects, Home/Index which pulls in all the js files. Extjs is essentially the V in my MVC, with my controllers only returning snippets of JSON. I really really like the way this separates the UI from business logic and data access in the controllers - I could, say, swap out my backend for a PHP one and as long as it returned the same data the front end would be blissfully unaware.
And yes, most of the new stuff in MVC 3 I don't use either.
After a pretty decent review of MVC, I love the pattern, looks very powerful and flexible. The one issue that I cannot really find a whole lot of info on, especially in regards to the Ext.Direct ASP.NET MVC router calls, is security. I've read the few articles on the MVC site, but they are pretty basic and gloss over a lot of the details by just telling you to use the Membership provider. I am not a big fan of that provider number one, and number two I am bolting on a new external web application to pull data from an internal web applicaiton (thru firewall) and will have to authenticate against the internal app's business security layer, passing in username/password.
My question really has sseveral parts:
1) How do you protect an entire MVC project's controller actions via Forms authentication, i.e. require that the user is authenticated before allowing use?
2) What is best way to do forms authentication for an MVC app, include a webform in the MVC project?
3) Is your only choice to implement the standard or a custom Membership Provider?
3) If I performed my own authentication methodology and created my own form auth ticket and then added this ticket t the context via context.Response.Cookies.Add(authCookie), does this get passed back and forth with the Direct calls or can I do something to make this happen?
Sorry for the lame questions on this...kinda clueless on how to get security working in this environment after coming form the ASP.Net world.
Thanks for any direction!
In MVC security is pretty much left up to you to handle.
1) FormsAuthentication.SetAuthCookie(username, false); then slap an
[Authorize] attribute on your controller or action.
2) See above.
3) Not at all
4) Absolutely, see (1). It's as simple as that.
You probably want to read this and this regarding unauthorized requests.