1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    25
    Vote Rating
    0
    EdgarAVJ is on a distinguished road

      0  

    Default AjaxPro and YUI-ext

    AjaxPro and YUI-ext


    Hi,

    I'm trying to combine YUI-ext as the front-end and AjaxPro to make the calls to the backend, but I'm having some problems.
    According to AjaxPro examples, all you need to do to call a method in the backend is to mark your .NET method with an AjaxMethod attribute. Then, to use the .NET method on the client-side JavaScript you have to register the methods using the AjaxPro.Utility.RegisterTypeForAjax function.
    When I do it in a “normal” page, everything works just fine.
    But when I try to do it in a page with a YUI-ext layout, it doesn’t work.
    I get an error message saying "Microsoft JScript runtime error: 'Security_Login' is undefined"

    Any ideas?

    Here’s the C# server code:

    Code:
    public partial class Security_Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(Security_Login));
        }
    
        [AjaxPro.AjaxMethod]
        private void Login(string inputUser, string inputPassword)
        {
            if (inputUser.Equals(string.Empty)) return;
            if (inputPassword.Equals(string.Empty)) return;
            // perform operations
        }
    }
    And here the JavaScript code:
    Code:
    Security_Login.Login('USER_PARAM', 'PASSWORD_PARAM');

  2. #2
    Ext User dotnetCarpenter's Avatar
    Join Date
    Mar 2007
    Location
    Copenhagen, Denmark
    Posts
    271
    Vote Rating
    0
    dotnetCarpenter is on a distinguished road

      0  

    Default


    I'm not sure, but I think the client library has to map/override the script that ASP.NET injects. YUI-Ext is not designed to fit ASP.NET or ASP.NET AJAX Extensions for that matter. The buildt in security features only works with the client library from Microsoft. You could of course design you own security implementation and the use the Memebership provider on the server (to at least save a little bit of plumbing code).

    Good luck!

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    5
    Vote Rating
    0
    egoicovic is on a distinguished road

      0  

    Default yui ext works & rocks on asp.net

    yui ext works & rocks on asp.net


    hi guys..

    I'd made various ajaxpro / yu ext sites . take a look at
    http://www.bgconsultores.cl/sapv

    all the site is under ext layout north,east and center regions

    tag you class declaration with a namespace, register your page class...mark your method as usual and make a qualified call

    ex:

    namespace sagi.userportal.reports
    {
    /// <summary>
    /// Summary description for viewreports.
    /// </summary>
    [AjaxPro.AjaxNamespace("sagi.userportal.reports.viewreports_solicitudesporedificio")]
    public class viewreports_solicitudesporedificio : System.Web.UI.Page

    private void Page_Load(object sender, System.EventArgs e)
    {
    AjaxPro.Utility.RegisterTypeForAjax(typeof(viewreports_solicitudesporedificio));

    }

    [AjaxPro.AjaxMethod]
    [PrincipalPermission(SecurityAction.Demand, Role = "users")]
    public int SolicitudExists(ESolicitud solicitud)
    {
    //method
    }
    }


    js call

    sagi.userportal.reports.viewreports_solicitudesporedificio.SolicitudExists(oBLL,yuiSolicitudesEdificio.validateSolicitud_callback,null,null,this.onError,this.onTimeout);

    sitenamespace.pageclass.method(param list[], callback,null,null, error control callback, timeout control callback)

  4. #4
    Ext User
    Join Date
    Mar 2007
    Posts
    25
    Vote Rating
    0
    EdgarAVJ is on a distinguished road

      0  

    Default


    Hi egoicovic,
    Thanks for your reply, I'll give it a try and let you know how it goes. :wink:

  5. #5
    Ext User
    Join Date
    Mar 2007
    Posts
    25
    Vote Rating
    0
    EdgarAVJ is on a distinguished road

      0  

    Default


    Hi egoicovic,
    I tried what you told me but it doesn't work.
    This is my code, maybe you could find what I'm missing.

    C#:
    Code:
    [AjaxPro.AjaxNamespace("Labs.Web.Security.Security_Login")] 
    public partial class Security_Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(Security_Login)); 
        }
    
        [AjaxPro.AjaxMethod] 
        public string Test1()
        {
            return "this is a test";
        }
    }
    JS call:

    Code:
        <script type="text/javascript"> 
            function doTest() {
                Labs.Web.Security.Security_Login.Test1(null, callback_doTest, null, null, null, null);
            }
            
            function callback_doTest(res)
            {
                alert(res);
            }
        </script>
    I get an error message saying: Microsoft JScript runtime error: 'Labs' is undefined

    Are you using the Framework 2.0?

  6. #6
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    194
    Vote Rating
    0
    INeedADip is on a distinguished road

      0  

    Default


    Look at the generated JavaScript, what class does it create?

  7. #7
    Ext User
    Join Date
    Mar 2007
    Posts
    25
    Vote Rating
    0
    EdgarAVJ is on a distinguished road

      0  

    Default


    There's no additional generated JavaScript.
    The only javascript in the page is the one I explicitly added.
    Any ideas?

  8. #8
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    194
    Vote Rating
    0
    INeedADip is on a distinguished road

      0  

    Default


    Then you are not successfully calling:
    Code:
    AjaxPro.Utility.RegisterTypeForAjax(typeof(Security_Login));
    Otherwise you would at least see something like:

    Code:
    <script type="text/javascript" src="/ajaxpro/prototype.ashx"></script>
    <script type="text/javascript" src="/ajaxpro/core.ashx"></script>
    <script type="text/javascript" src="/ajaxpro/converter.ashx"></script>

  9. #9
    Sencha User
    Join Date
    Mar 2007
    Posts
    754
    Vote Rating
    1
    franklt69 is on a distinguished road

      0  

    Default


    Hi egoicovic, good site I like the login page, is there any usuario and Contraseña to do login and watch the site?

    are you using ext1 form validation components?

    are you using some component asp.net to do (Código de Verificación) I mean some component to change the image generated from the server?

    kind regards
    Frank

  10. #10
    Ext User
    Join Date
    Mar 2007
    Posts
    5
    Vote Rating
    0
    egoicovic is on a distinguished road

      0  

    Default js class not emited

    js class not emited


    Edgar...be sure that in core.ashx you have wrapper for your classes


    I'm using asp.net 2.0 and 1.1...the site showed is 1.1

    javascript emited area missing the class wrapper

    that look like for previous example

    <script type="text/javascript" src="/sagi/ajaxpro/sagi.userportal.reports.viewreports_solicitudesporedificio,sagi.ashx"></script>

    and the inner js

    if(typeof sagi == "undefined") sagi={};
    if(typeof sagi.userportal == "undefined") sagi.userportal={};
    if(typeof sagi.userportal.reports == "undefined") sagi.userportal.reports={};
    if(typeof sagi.userportal.reports.viewreports_solicitudesporedificio == "undefined") sagi.userportal.reports.viewreports_solicitudesporedificio={};
    sagi.userportal.reports.viewreports_solicitudesporedificio_class = function() {};
    Object.extend(sagi.userportal.reports.viewreports_solicitudesporedificio_class.prototype, Object.extend(new AjaxPro.AjaxClass(), {
    GetInfoSolicitud: function(search, count) {
    return this.invoke("GetInfoSolicitud", {"search"earch, "count":count}, this.GetInfoSolicitud.getArguments().slice(2));
    },
    SolicitudExists: function(solicitud) {
    return this.invoke("SolicitudExists", {"solicitud"olicitud}, this.SolicitudExists.getArguments().slice(1));
    },
    url: '/sagi/ajaxpro/sagi.userportal.reports.viewreports_solicitudesporedificio,sagi.ashx'
    }));
    sagi.userportal.reports.viewreports_solicitudesporedificio = new sagi.userportal.reports.viewreports_solicitudesporedificio_class();


    On next monday I post a clone site for playing

    validation is a mixed case of yui ext and a modified js library

    the captcha component is from codeproject.com

Similar Threads

  1. Ext and ajaxPro
    By rodiniz in forum Ext 2.x: Help & Discussion
    Replies: 24
    Last Post: 21 Aug 2008, 11:17 AM
  2. Yui, Client-Side SQL Query and AjaxPro for .NET
    By Choleriker in forum Community Discussion
    Replies: 9
    Last Post: 12 Dec 2006, 7:27 AM

Thread Participants: 5

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar