1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    2
    Vote Rating
    0
    ndani1014 is on a distinguished road

      0  

    Default Using Sencha Ext JS in .NET Applications

    Using Sencha Ext JS in .NET Applications


    Hello,

    We routinely develop business applications using the .NET platform. I would like to know if we are able to use Ext JS in conjunction with ASP.NET? If yes, do we use the Ext JS grid instead of the native 'Gridview' available in .NET?

    Anyone here who has been using Ext JS with ASP.NET, please reply.

    Regards,

    Nimesh Dani

  2. #2
    Ext JS Premium Member Brendan Carroll's Avatar
    Join Date
    May 2007
    Location
    Balmer, MD.
    Posts
    139
    Vote Rating
    1
    Brendan Carroll is on a distinguished road

      0  

    Default Search the forum

    Search the forum


    There are plenty of examples using Ext targeting the different .Net frameworks 2 - 4 (WCF, handlers, asmx etc...). Do a little research first then come back and ask specifics. We've been doing it since 1.1
    -BC ...

  3. #3
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,777
    Vote Rating
    112
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    This might interest you, Ext wrapped in .NET controls: http://www.ext.net/

  4. #4
    Sencha User brittongr's Avatar
    Join Date
    Jun 2007
    Location
    Panama
    Posts
    109
    Vote Rating
    3
    brittongr is on a distinguished road

      0  

    Default


    If you decide to use ExtJS instead of Ext.NET i recommend you to not mix asp.net controls code and extjs code, you will end up with some weird behaviors...
    Greivin Britton

    My Extensions:
    Ext.ux.NumericField: Number field with support for currencySymbol, thousand separator, international...
    Ext.ux.PagerSizeSelector: A plugin that allows the change page size with just one click.
    Ext.ux.FieldAccess: A plugin to let the user know which fields are editable.

  5. #5
    Sencha User
    Join Date
    Nov 2011
    Posts
    2
    Vote Rating
    0
    ndani1014 is on a distinguished road

      0  

    Default ExtJS or Ext.Net

    ExtJS or Ext.Net


    Thank you for the earlier responses so far.

    I am back with a few new questions/concerns:

    1. I have been looking at ExtJS as well as Ext.NET. Which one should be used? Is Ext.NET the one to use for .NET applications rather than ExtJS?

    2. I have noticed that ASP.NET MVC is mostly used with ExtJS. However, does it work equally well when considering Web Forms? Any particular disadvantages?

    Thanking you in anticipation.

    Regards,

    Nimesh Dani

  6. #6
    Sencha Premium Member
    Join Date
    Oct 2009
    Location
    Leeds
    Posts
    65
    Vote Rating
    9
    damo will become famous soon enough

      0  

    Default


    Quote Originally Posted by ndani1014 View Post
    Thank you for the earlier responses so far.

    I am back with a few new questions/concerns:

    1. I have been looking at ExtJS as well as Ext.NET. Which one should be used? Is Ext.NET the one to use for .NET applications rather than ExtJS?

    2. I have noticed that ASP.NET MVC is mostly used with ExtJS. However, does it work equally well when considering Web Forms? Any particular disadvantages?

    Thanking you in anticipation.

    Regards,

    Nimesh Dani
    Neither "should" be used, it depends on what your comfortable with using.

    Me personally I prefer to use the server side code to mainly get and set data and the ExtJS front end handle all the visual UI aspects.

    Asp.Net MVC works well because with a ExtJS app it's very simple to return the required data as JSON and then to post that back to the server, whereas web forms (not used them an aweful lot) mix the presentation html with server side code which can complicate things slightly.

  7. #7
    Sencha User
    Join Date
    Nov 2014
    Posts
    8
    Vote Rating
    0
    jrock1979 is on a distinguished road

      0  

    Default


    Quote Originally Posted by Brendan Carroll View Post
    There are plenty of examples using Ext targeting the different .Net frameworks 2 - 4 (WCF, handlers, asmx etc...). Do a little research first then come back and ask specifics. We've been doing it since 1.1
    Where are these examples?

  8. #8
    Touch Premium Member
    Join Date
    Sep 2011
    Location
    Tamworth, NSW, Australia
    Posts
    613
    Vote Rating
    45
    marc.fearby has a spectacular aura about marc.fearby has a spectacular aura about marc.fearby has a spectacular aura about

      0  

    Default


    I've been using Ext JS since 4.0 in late 2011 with .NET c# WCF RESTful web services. I never used Ext.NET as it seemed too closely coupled with .NET and that just sounds evil to me (is it even a Sencha product or is it an early fork of YUI or something?)

    My web services handle the to and fro between the Ext JS front end and the database back-end (using plain old SqlCommand objects with SQL I write myself or calling stored procedures where necessary). It's a lot of hard work to get going, since it's almost all "do it yourself" but you have complete control over everything, if that's what you want. I have what I call a "Payload" (plain old CLR object) which has .data, .message, .success, and .total public properties to mirror what Ext JS expects.

    This part of my web.config ensures that when I return a payload object from a method, it automatically serialises it to JSON:

    Code:
    <system.serviceModel>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
            <!-- These are needed when using additional site bindings in IIS when hosting multiple sites/cnames -->
            <baseAddressPrefixFilters>
                <add prefix="http://localhost/"/>
            </baseAddressPrefixFilters>
        </serviceHostingEnvironment>
        <standardEndpoints>
            <webHttpEndpoint>
                <!-- faultExceptionEnabled="true" will send exceptions as XML and not JSON -->
                <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="false" defaultOutgoingResponseFormat="Json"/>
            </webHttpEndpoint>
        </standardEndpoints>
    </system.serviceModel>
    I remember this being a very helpful resource to get me started three years ago. There may be something better, but I still code my services this way:

    Introducing WCF WebHttp Services in .NET 4

    Here's a simple service to echo your username only:

    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.ServiceModel;
    using System.ServiceModel.Activation;
    using System.ServiceModel.Web;
    
    namespace MyService
    {
        [ServiceContract]
        [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
        [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
        public class EchoUsernameService
        {
            public EchoUsernameService()
            {
    
            }
    
            [WebGet(UriTemplate = "/")]
            public string getUserName()
            {
                return ServiceSecurityContext.Current.WindowsIdentity.Name; // System.Web.HttpContext.Current.User.Identity.Name;
            }
        }
    }
    Each service needs to be registered in Global.asax.cs as follows:

    Code:
    using System;
    using System.ServiceModel.Activation;
    using System.Web;
    using System.Web.Routing;
    
    namespace MyService
    {
        public class Global : HttpApplication
        {
            void Application_Start(object sender, EventArgs e)
            {
                RegisterRoutes();
            }
    
    
            private void RegisterRoutes()
            {
                // Routes for service handlers. These will expose the entry points in each class via [IIS_Virtual]/Whatever/... (for example)
                RouteTable.Routes.Add(new ServiceRoute("EchoUsername", new WebServiceHostFactory(), typeof(EchoUsernameService)));
            }
        }
    }
    When I call http://localhost/MyAppVirtual/EchoUsername it simply returns a JSON formatted string (with quotation marks):

    "myusername"

    Obviously, I'd be returning a Payload object (with an ArrayList of objects in the .data property) when connecting things to stores, but if you want to do a simple Ajax request yourself and process the result, then I sometimes do this to get just a string value.

    Hope this helps.