facebook registration plug-in Async Validation

后端 未结 1 1806
执念已碎
执念已碎 2020-12-20 09:54

I am trying to impliment facebook registration pluging from last three weeks, to check the username avaiablity I am using jquery and JSON, accourding to this http://develop

1条回答
  •  不思量自难忘°
    2020-12-20 10:17

    FB registration page should look like as follows

    
    
    

    Note how I mentioned server file name (it is without full URL, as both files were on same root dir) in validate_async(form, cb) function

    
            $.getJSON('test02.aspx?username=' + form.username,
    

    Test02.aspx page should look like as follows

    
    
    

    Note no html, body or head tags in test02.aspx (Test02.aspx.cs) should look like

    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Newtonsoft.Json;
    using System.Text;
    
    public partial class test02 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e1)
        {
            StringBuilder JSON = new StringBuilder();
    
            //validate from your database and execute one of the following two lines.
    
           JSON.Append("{\"error\":\"Exist\"}"); // username is taken
    
         //  JSON.Append("{\"anything\":\"Not Exist\"}");
    
    
            Response.Write(JSON.ToString());
    
            Response.End(); 
    
        }
    }
    

    0 讨论(0)
提交回复
热议问题