簡體   English   中英

使用 c# 對 facebook 注冊插件進行異步驗證

[英]async validation on facebook registration plug-in using c#

我正在使用 c# 2010 集成 facebook 注冊插件,我能夠添加自定義字段以及讀取簽名請求。 現在我想添加異步驗證來檢查用戶名是否可用。 以下是我正在使用的腳本

<body>

   <fb:login-button
registration-url="http://developers.facebook.com/docs/plugins/registration" />

<div id="fb-root"></div>

<script src="http://connect.facebook.net/en_US/all.js#appId=***********&xfbml=1"></script>

   <fb:registration redirect-uri="http://localhost:1913/urecommendme/test3.aspx/"
  fields='[{"name":"name"},
           {"name":"username","description":"Username","type":"text"}]' 
  onvalidate="validate_async"></fb:registration> 


<script src="http://code.jquery.com/jquery-1.4.4.min.js"></script>

<script>
    function validate_async(form, cb) {
  $.getJSON('http://graph.facebook.com/' + form.username + '?callback=?', 
    function (response) {
        if (response.error) {
            // Username isn't taken, let the form submit
            cb();
        }
        cb({ username: 'That username is taken' });
    });
    }
</script> 


</body>

當我按下注冊按鈕時,表格消失了,什么也沒有發生。 有人可以告訴我我是否正確處理了這個問題嗎? 另外,我不知道我應該在哪里指定服務器端腳本的路徑/名稱,這是我編寫 c# 代碼來檢查用戶名可用性的地方。

這個問題在這里解決

facebook注冊插件Async Validation

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM