Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 238449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:30:23+00:00 2026-05-11T20:30:23+00:00

I have an ASP.NET page where i will check whether the user has logged

  • 0

I have an ASP.NET page where i will check whether the user has logged in to the system (by checking the session value) in the page load and if not logged in,it will show a jQueryUI dialog for login.

My ASPX page contains these script in the head tag

<style type="text/css">
    body { font-size: 62.5%; }
    label, input { display:block; }
    input.text { margin-bottom:12px; width:95%; padding: .4em; }
    fieldset { padding:0; border:0; margin-top:25px; }
    h1 { font-size: 1.2em; margin: .6em 0; }
    div#users-contain {  width: 350px; margin: 20px 0; }
    div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
    div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
    .ui-button { outline: 0; margin:0; padding: .4em 1em .5em; text-decoration:none;  !important; cursor:pointer; position: relative; text-align: center; }
    .ui-dialog .ui-state-highlight, .ui-dialog .ui-state-error { padding: .3em;  }


</style>
<script type="text/javascript">
$(function() {

    var name = $("#name"),
        email = $("#email"),
        password = $("#password"),
        allFields = $([]).add(name).add(email).add(password),
        tips = $("#validateTips");

    function updateTips(t) {
        tips.text(t).effect("highlight",{},1500);
    }


    function checkRegexp(o,regexp,n) {

        if ( !( regexp.test( o.val() ) ) ) {
            o.addClass('ui-state-error');
            updateTips(n);
            return false;
        } else {
            return true;
        }

    }

    $("#dialog").dialog({
        bgiframe: true,
        autoOpen: false,
        height: 250,
        modal: true,
        buttons: {
                Cancel: function() {
                $(this).dialog('close');
                },                                  
                NewUser: function() {
                 $(this).dialog('close');
                 window.location.href="Register.aspx";
                },
                'Sign in': function() {
                var bValid = true;
                allFields.removeClass('ui-state-error');


                bValid=true;
                isValidationFails=false;
                if (bValid)
                {              
                                        // Go to another page

                    } 
                }
            }
        },
        close: function() {
            allFields.val('').removeClass('ui-state-error');
        }
    });



    $('#create-user').click(function() {
         $(this).dialog('close');
         window.location.href="Register.aspx"
    })
    .hover(
        function(){ 
            $(this).addClass("ui-state-hover"); 
        },
        function(){ 
            $(this).removeClass("ui-state-hover"); 
        }
    ).mousedown(function(){
        $(this).addClass("ui-state-active"); 
    })
    .mouseup(function(){
            $(this).removeClass("ui-state-active");
    });

//});
var isAuthenticated = $("#isAuthenticated").val();
if (isAuthenticated && isAuthenticated == "false")
{
  $("#dialog").dialog("open");
}

});

</script>

SErver side code (in Page_Load)

 if (Session["trCustomerId"] != null)
        {
            Response.Write("Logged in user");
            ClientScript.RegisterHiddenField("isAuthenticated", "true");
        }
        else
        {
            ClientScript.RegisterHiddenField("isAuthenticated", "false");
        }

The program is working fine now . But the problem is when the page is loading,it is showing the UIDialog div for 1-2 seconds in the screen and then disappearing. I dont want to show like this.Can any one tell me how to solve this ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:30:23+00:00Added an answer on May 11, 2026 at 8:30 pm

    Try setting the style on your dialog markup to display:none;

    #dialog{
       display: none;
    }
    

    You can then show it if the dialog.open doesn’t do it for you.

    $('#dialog').show()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to do a asp.net web page that when load will say something
I have an ASP.Net page that will be hosted on a couple different servers,
I have an asp.net page that calls a dll that will start a long
I have a button on an ASP.Net page that will call Response.Redirect back to
I have a asp.net page, and would like to know whether script1 is already
I have an ASP.NET page which has a script manager on it. <form id=form1
i have to create one asp.net mvc page that will show template of controls.
I have an ASP.NET MVC web app which has a really basic subscription system
I'm writing a contact form in ASP.NET MVC. The user will have the ability
I have ASP.NET page with an iframe on it for displaying some pdf reports

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.