Click here to Skip to main content
15,891,835 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
code no1
+++++++++++++
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="login131.aspx.cs" Inherits="login131" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<table width="100%" border="0">
<tr>
<td><asp:Label ID="Label1" runat="server" Text="Email"></asp:Label></td>
<td><asp:TextBox ID="Textemail1" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td><asp:Label ID="Label2" runat="server" Text="pass"></asp:Label></td>
<td><asp:TextBox ID="Textpass2" runat="server" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" align="center"><asp:Button ID="Button1" runat="server"
onclick="Button1_Click" Text="login" style="width: 41px" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="Textemail1" Display="None"
ErrorMessage="Please enter email"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
ControlToValidate="Textpass2" Display="None"
ErrorMessage="please enter password"></asp:RequiredFieldValidator>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" Height="37px"
ShowMessageBox="True" ShowSummary="False" Width="164px" />
</td>
</tr>
<tr>
<td colspan="2" align="center"><asp:Label ID="lblMessage" runat="server"></asp:Label></td>
</tr>
</table>

</asp:Content>
+++++++++
code2
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Web.Configuration;

public partial class login131 : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["registrationConnectionString"].ConnectionString);
SqlCommand cmd;
SqlDataReader dr;
int flag = 0;
protected void Page_Load(object sender, EventArgs e)
{
SetFocus(Textemail1);
}
protected void Button1_Click(object sender, EventArgs e)
{
string sql="select email,password from registration where email='" + Textemail1.Text + "' and password '" + Textpass2.Text + "'";
cmd=new SqlCommand(sql,con);
con.Open();
dr=cmd.ExecuteReader();
if(dr.Read())
{flag=1;
}
else
{
flag=0;
}
con.Close();
dr.Close();
if (flag == 1)
{
Response.Redirect("~/welcome.aspx");
}
else
{
msg("Wrong username or password, Access Denied");
}

}

public void msg(string msg1)
{
Literal ltr = new Literal();
ltr.Text = "<script language='javascript'>alert('" + msg1 + "')</script>";
this.Page.Controls.Add(ltr);
}
}
++++++++
code3
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<table width="950px" align="center" style="height: 30%">
<tr>
<td style="width:100%;">
<table width="100%">
<tr>
<td colspan="4" style="width:100%;background-color:Maroon; height: 20px;"
align="center">

<!-- <p style="background-color:Maroon; font-size:16px; color:White;
margin-top:0px; height:40px; width:950px">
</p>
-->

</td>
</tr>
</table>


<table style="margin-top:0px;background-image:url('/F:/WebSiteregistration/Sunset.jpg');"
width="100%">
<tr>
<!-- Start of Content Place Holder --background-color:#333333;-->
<td valign="top" style="height:475px; width:100%; "
align="left">
<asp:ContentPlaceHolder id="ContentPlaceHolder2" runat="server">
</asp:ContentPlaceHolder>
</td>
<!-- End of Content Place Holder-->
</tr>

<tr>
<td colspan="2" valign="middle" align="center" style="Background-color:##000080; height:30px; width:100%">
<p style="font-size:12px; font-family:Verdana; color:White;">
Copyright © 2011, sujeet sir registration System.

Designed by sujeet sir
</p>

</td>
</tr>
</table>


</form>
</body>
</html>

+++++++++++++
in code3 :-i am having sunset.jpeg,in background in master page of masterpage.master,but when we take masterpage.master it in codeno1 login131.aspx the the sunset.jpeg cant be seen when we see it in browser.
Posted
Comments
krumia 17-Feb-12 13:50pm    
Please try to post the minimal amount of code... And please don't forget to put code formatting tags too.

1 solution

url('/F:/WebSiteregistration/Sunset.jpg');

Really? Try using a URL that is in a valid format, and points to somewhere on the server.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900