3 Replies - 623 Views - Last Post: 05 February 2011 - 11:02 AM Rate Topic: -----

#1 Atomika3000  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 88
  • Joined: 15-October 10

Changing the browser URL

Posted 04 February 2011 - 08:54 AM

I am making a simple login system, then if the users details are correct, it will navigate to a different website (example: Google)

This is my code so far

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        string password;

        protected void Page_Load(object sender, EventArgs e)
        {
            StreamReader passwordStream = new StreamReader(@"K:\Uni (Year 3)\EJ315020S - Windows Application Devlopment\Projects\AssignmentProgram\LoginSystem\password.txt");

            while (passwordStream.Peek() >= 0)
            {
                password = passwordStream.ReadLine();
            } 
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (TextUsername.Text == "Jbloggs")
            {
                if (TextPassword.Text == password)
                {
                    
                }
            }
            else
            {
               
            }
        }       
    }
}

i have searched for it, but all i can find is things about "URL Routing"

Thanks for the help

Is This A Good Question/Topic? 0
  • +

Replies To: Changing the browser URL

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,960
  • Joined: 21-March 08

Re: Changing the browser URL

Posted 04 February 2011 - 09:14 AM

You can use Response.Redirect.
Was This Post Helpful? 0
  • +
  • -

#3 Atomika3000  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 88
  • Joined: 15-October 10

Re: Changing the browser URL

Posted 04 February 2011 - 09:54 AM

Brilliant works perfectly, thought, is there a message/alert box function?

in C#.net i had to type

MessageBox.Show()


but that does nothing
Was This Post Helpful? 0
  • +
  • -

#4 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,960
  • Joined: 21-March 08

Re: Changing the browser URL

Posted 05 February 2011 - 11:02 AM

You will need to use javascript to do an alert box in ASP.Net.

http://www.mediacoll...asic/alert.html
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1