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 7609239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:07:35+00:00 2026-05-31T01:07:35+00:00

I am trying to run the following script: Here LoginName1 is a System.Web.UI.WebControls.LoginName .

  • 0

I am trying to run the following script:

Here LoginName1 is a System.Web.UI.WebControls.LoginName. The LoginName1 displays the username in the webpage just fine.
However it does not seem to work. Where am i going wrong?

Here is the full code [latest]:

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site1.master" AutoEventWireup="true"
    CodeBehind="~/Default.aspx.cs" Inherits="memberlogin.Default" %>


<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<script runat="server" >
    public void redirect()
    {// I have removed previous content - it JUST WONT REDIRECT THE PAGE
        //String loginame = System.Web.HttpContext.Current.User.Identity.Name;
        //if (loginame == "usertest")
        Response.Redirect( "Default.aspx");   
       }
</script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent" >
    <h1>
        <span class="input">Welcome to the members-only page.</span>
    </h1>
    <h2>
        Start Client Side Application.
    </h2>
                        <asp:LoginView ID="LoginView1" runat="server">
                <AnonymousTemplate>
                    <span class="input">&nbsp;You are not logged in. Click the Login link to sign in</span>
                </AnonymousTemplate>
                <LoggedInTemplate>
                    <span class="input">You are logged in. Welcome, </span>
                </LoggedInTemplate>
            </asp:LoginView>
            <asp:LoginName ID="LoginName1" runat="server" />
            &nbsp;&nbsp;
            <table class="style1">
                <tr>
                    <td align="center" valign="middle">
            <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        Click on This Image Link To Start The Application<br />
                        <br />
                        <asp:ImageButton   OnClick="click" runat="server" ID="ImageButton1" Height="100px" 
                            ImageUrl="~/Images/loader.jpg" PostBackUrl="~/Loading.aspx" />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                    </td>
                </tr>
            </table>
            <asp:LoginStatus ID="LoginStatus1" runat="server" 
                LogoutAction="Redirect" BackColor="White" 
                Font-Underline="True" LogoutPageUrl="~/Default.aspx" />

</asp:Content>
  • 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-31T01:07:36+00:00Added an answer on May 31, 2026 at 1:07 am

    Have you tried getting the username from HttpContext.Current.User.Identity.Name?

    Judging from the context, I’m guessing that LoginName1 is a label or another .NET control that does not have any ViewState associated with it. If so, the code above should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the following error from the SQL Script I am trying to run:
I'm trying to run the script found here: http://blog.sebflipper.co.uk/2010/03/10/mysql-backup-as-separate-sql-files-with-rotation/comment-page-1/ bash /path/to/mysql-backup.sh I'm getting the
I am trying to run the following HelloWorld Script at Command Line import tornado.httpserver
I am trying to run the following commands from a .sh script at the
I'm trying to run Adobe's sample python policy server script, linked to here: http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html
OK here is my issue: I am trying to run a script remotely on
Trying to run the following command in php to run powershell command... the following
I'm trying to run the following commands: replace -x must A2input.txt replace -x a
I'm trying to run the following command: find . -iname '.#*' -print0 | xargs
I am trying to run the following code from within Eclipse: Process process =

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.