Siverlight 4 中的无尽加载屏幕

发布于 2024-09-30 16:36:10 字数 2853 浏览 0 评论 0原文

编译和运行后,当我尝试在 Google Chrome 或 Mozilla Firefox 中加载页面时,它只显示蓝色的进度,在圆圈中旋转,一瞬间它会显示一个百分比,然后消失

整个登录页面的代码

public partial class LoginPage : UserControl
    {
        public bool UsernameExists = false;
        public bool PasswordExists = false;
        public bool SchoolExists = false;
        public LoginPage()
        {
            InitializeComponent();
        }

        private void username_autocompletebox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //Checks if user entered all neccessary values, enables Login_button if so
            if (username_autocompletebox.Text.Length != 0)
            {
                UsernameExists = true;
            }
            else
            {
                UsernameExists = false;
            }
            if (UsernameExists = true && PasswordExists == true && SchoolExists == true)
            {
                Login_button.IsEnabled = true;
            }
            else
            {
                Login_button.IsEnabled = false;
            }
        }

        private void password_passwordbox_PasswordChanged(object sender, RoutedEventArgs e)
        {
            //Checks if user entered all neccessary values, enables Login_button if so
            if (password_passwordbox.Password.Length != 0)
            {
                PasswordExists = true;
            }
            else
            {
                PasswordExists = false;
            }
            if (UsernameExists = true && PasswordExists == true && SchoolExists == true)
            {
                Login_button.IsEnabled = true;
            }
            else
            {
                Login_button.IsEnabled = false;
            }
        }

        private void school_combobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //Checks if user entered all neccessary values, enables Login_button if so
            if (school_combobox.SelectedItem != null && school_combobox.SelectedItem.ToString() != "Select a School")
            {
                SchoolExists = true;
            }
            else
            {
                SchoolExists = false;
            }
            if (UsernameExists = true && PasswordExists == true && SchoolExists == true)
            {
                Login_button.IsEnabled = true;
            }
            else
            {
                Login_button.IsEnabled = false;
            }
        }

        private void Login_button_Click(object sender, RoutedEventArgs e)
        {
            Authenticate Authenticator = new Authenticate();
            User CurrentUser = Authenticator.Login(username_autocompletebox.Text, password_passwordbox.Password, school_combobox.SelectedItem.ToString());
        }
    }

Upon Compiling and Running, when I try to load the page in either Google Chrome or Mozilla Firefox it just shows the blue progress thing rotating in circles, and for a split second it will show a percentage and then that disappears

Code for entire LoginPage

public partial class LoginPage : UserControl
    {
        public bool UsernameExists = false;
        public bool PasswordExists = false;
        public bool SchoolExists = false;
        public LoginPage()
        {
            InitializeComponent();
        }

        private void username_autocompletebox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //Checks if user entered all neccessary values, enables Login_button if so
            if (username_autocompletebox.Text.Length != 0)
            {
                UsernameExists = true;
            }
            else
            {
                UsernameExists = false;
            }
            if (UsernameExists = true && PasswordExists == true && SchoolExists == true)
            {
                Login_button.IsEnabled = true;
            }
            else
            {
                Login_button.IsEnabled = false;
            }
        }

        private void password_passwordbox_PasswordChanged(object sender, RoutedEventArgs e)
        {
            //Checks if user entered all neccessary values, enables Login_button if so
            if (password_passwordbox.Password.Length != 0)
            {
                PasswordExists = true;
            }
            else
            {
                PasswordExists = false;
            }
            if (UsernameExists = true && PasswordExists == true && SchoolExists == true)
            {
                Login_button.IsEnabled = true;
            }
            else
            {
                Login_button.IsEnabled = false;
            }
        }

        private void school_combobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //Checks if user entered all neccessary values, enables Login_button if so
            if (school_combobox.SelectedItem != null && school_combobox.SelectedItem.ToString() != "Select a School")
            {
                SchoolExists = true;
            }
            else
            {
                SchoolExists = false;
            }
            if (UsernameExists = true && PasswordExists == true && SchoolExists == true)
            {
                Login_button.IsEnabled = true;
            }
            else
            {
                Login_button.IsEnabled = false;
            }
        }

        private void Login_button_Click(object sender, RoutedEventArgs e)
        {
            Authenticate Authenticator = new Authenticate();
            User CurrentUser = Authenticator.Login(username_autocompletebox.Text, password_passwordbox.Password, school_combobox.SelectedItem.ToString());
        }
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

流云如水 2024-10-07 16:36:10

很可能在 Application_UnHandledException 中处理未处理的异常。在您的 Application_UnHandledException 处理程序中放置一个断点以查看问题,或者在 VS 打开未处理异常抛出时的通知。您还可以在浏览器中找到堆栈跟踪来查看问题。当 XAML 某处不正确时,通常会发生这种情况。引用可能不存在的事件处理程序或样式等...

Most likely an unhandled exception being handled in Application_UnHandledException. Place a breakpoint at your Application_UnHandledException handler to see the problem, or in VS turn on the notification of unhandled exceptions when they are thrown. You could also locate the stacktrace in the browser to see the problem. This typically occurs when the XAML is incorrect somewhere. Referencing event handlers which may not exist, or styles, etc...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文