c#+jquery+ajax实现注册登录功能 50C

数据库是sql server 客户端和服务器端怎么交换数据
页面代码如下

 <nav class="main_nav">
            <ul>
                <li ><a class="cd-signin" href="#0">登录</a></li>
                <li ><a class="cd-signup" href="#0">注册</a></li>
            </ul>
        </nav>
    <div class="cd-user-modal"> 
        <div class="cd-user-modal-container">
            <ul class="cd-switcher">
                <li ><a href="#0">用户登录</a></li>
                <li ><a href="#0">注册新用户</a></li>
            </ul>

            <div id="cd-login"><!-- 登录表单 -->
                <form class="cd-form" method="post">
                    <p class="fieldset">
                        <label class="image-replace cd-username" for="signin-username-email">姓名或邮箱</label>
                        <input class="full-width has-padding has-border" id="signin-username" type="text" placeholder="输入姓名或邮箱" >
                    </p>

                    <p class="fieldset">
                        <label class="image-replace cd-password" for="signin-password">密码</label>
                        <input class="full-width has-padding has-border" id="signin-password" type="text"  placeholder="输入密码">
                    </p>

                    <p class="fieldset">
                        <input type="checkbox" id="remember-me" checked>
                        <label for="remember-me">记住登录状态</label>
                    </p>

                    <p class="fieldset">
                        <input class="full-width2" id="login" type="submit" value="登 录">
                    </p>
                </form>
            </div>

            <div id="cd-signup"> <!-- 注册表单 -->
                <form class="cd-form" method="post">
                    <p class="fieldset">
                        <label class="image-replace cd-username" for="signup-username">姓名</label>
                        <input class="full-width has-padding has-border" id="signup-username" type="text" placeholder="输入姓名">
                    </p>

                    <p class="fieldset">
                        <label class="image-replace cd-email" for="signup-email">邮箱</label>
                        <input class="full-width has-padding has-border" id="signup-email" type="email" placeholder="输入mail">
                    </p>

                    <p class="fieldset">
                        <label class="image-replace cd-password" for="signup-password">密码</label>
                        <input class="full-width has-padding has-border" id="signup-password" type="text"  placeholder="输入密码">
                    </p>

                    <p class="fieldset">
                        <input type="checkbox" id="accept-terms">
                        <label for="accept-terms">我已阅读并同意 <a href="#0">用户协议</a></label>
                    </p>

                    <p class="fieldset">
                        <input class="full-width2" id="register" type="submit" value="注册新用户">
                    </p>

                </form>
            </div>

            <a href="#0" class="cd-close-form">关闭</a>
        </div>
    </div>

js代码如下:

 jQuery(document).ready(function ($) {
    var $form_modal = $('.cd-user-modal'),
        $form_login = $form_modal.find('#cd-login'),
        $form_signup = $form_modal.find('#cd-signup'),
        $form_modal_tab = $('.cd-switcher'),
        $tab_login = $form_modal_tab.children('li').eq(0).children('a'),
        $tab_signup = $form_modal_tab.children('li').eq(1).children('a'),
        $main_nav = $('.main_nav');

    //弹出窗口
    $main_nav.on('click', function (event) {

        if ($(event.target).is($main_nav)) {
            // on mobile open the submenu
            $(this).children('ul').toggleClass('is-visible');
        } else {
            // on mobile close submenu
            $main_nav.children('ul').removeClass('is-visible');
            //show modal layer
            $form_modal.addClass('is-visible');
            //show the selected form
            ($(event.target).is('.cd-signup')) ? signup_selected() : login_selected();
        }

    });

    //关闭弹出窗口
    $('.cd-user-modal').on('click', function (event) {
        if ($(event.target).is($form_modal) || $(event.target).is('.cd-close-form')) {
            $form_modal.removeClass('is-visible');
        }
    });

    //使用Esc关闭弹出窗口
    $(document).keyup(function (event) {
        if (event.which == '27') {
            $form_modal.removeClass('is-visible');
        }
    });


    //切换表单
    $form_modal_tab.on('click', function (event) {
        event.preventDefault();
        ($(event.target).is($tab_login)) ? login_selected() : signup_selected();
    });

    function login_selected() {
        $form_login.addClass('is-selected');
        $form_signup.removeClass('is-selected');
        $form_forgot_password.removeClass('is-selected');
        $tab_login.addClass('selected');
        $tab_signup.removeClass('selected');
    }

    function signup_selected() {
        $form_login.removeClass('is-selected');
        $form_signup.addClass('is-selected');
        $form_forgot_password.removeClass('is-selected');
        $tab_login.removeClass('selected');
        $tab_signup.addClass('selected');
    }



});


//credits http://css-tricks.com/snippets/jquery/move-cursor-to-end-of-textarea-or-input/
jQuery.fn.putCursorAtEnd = function () {
    return this.each(function () {
        // If this function exists...
        if (this.setSelectionRange) {
            // ... then use it (Doesn't work in IE)
            // Double the length because Opera is inconsistent about whether a carriage return is one character or two. Sigh.
            var len = $(this).val().length * 2;
            this.setSelectionRange(len, len);
        } else {
            // ... otherwise replace the contents with itself
            // (Doesn't work in Google Chrome)
            $(this).val($(this).val());
        }
    });
};

接下来该怎么写功能 与数据库交换数据 最好有详细代码 谢谢了!

2个回答

qq_29271151
qq_29271151 我技术有点差 还是实现不了,能贴下具体的代码吗,你给的是access的
接近 5 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐