Question

I have an user control and aspx login page. Now i validate login page and send return message to ascx page.i dont know whether it's possible or not. Please help me.

<%@ Register Src="~/usercontrol/WUC_MessageBoxes.ascx" TagName="MessageBox" TagPrefix="UC" %>

<script type="text/javascript">
        function ValidateLogin() {
            try {
                var user = document.getElementById('login')
                var pass = document.getElementById('password')
                var msg = document.getElementById('<%=mydatatopass.ClientID%>').innerHTML;
                msg = "haioasdfasdfasdf";
                if (user.textContent != '') {
                    if (pass.textContent != '') {
                      //Pass Error Message to User Control

                    } else {                          //Pass Error Message to User Control }

                } else {
                }
            }
            catch (ex) {

                alert(ex.message)
            }
        }
    </script> 

No correct solution

OTHER TIPS

Post your form to the controller using Ajax

function () {
        $.ajax("/YourController/YourMethod", {
            data: ko.toJSON({ your data goes here }),
            type: "post", contentType: "application/json",
            success: function (result) {
                if (result.success) {
                    //what happens on success
                }
                else {
                    alert(result.success)
                }
            },

        });
    };
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top