how can i do this login form in Asp.Net ???
help me plz...
|:
Add two textboxes and two buttons onto the webform.
this is model popup in ajax.
use below link for your code solutions
http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx
Register Ajax
on Aspx
I hope it will work For you
<cc1:ModalPopupExtender ID="MPE" TargetControlID="lnkView" CancelControlID="btnCancel" PopupControlID="panViewDetails" runat="server" BackgroundCssClass="modalBackground" PopupDragHandleControlID="panViewDetails"></cc1:ModalPopupExtender>
<asp:Panel ID="panViewDetails" runat="server" CssClass="modalPopup" style="display:none;">
<table width="100%" cellpadding="2" cellspacing="2" class="table">
<tr>
<td align="left">
<table width="100%" cellpadding="2" cellspacing="2" class="table">
<tr><td align="center" colspan="2" class="query">User Information</td></tr>
<tr>
<td class="query">Name:</td>
<td class="query2" style="width: 180px;">
<asp:TextBox ID="TextBox1" runat="server" Enabled="false"></asp:TextBox> </td>
</tr>
<tr>
<td class="query">Name:</td>
<td class="query2" style="width: 180px;">
<asp:TextBox ID="TextBox1" runat="server" Enabled="false"></asp:TextBox> </td>
</tr>
<tr>
<td class="query">Name:</td>
<td class="query2" style="width: 180px;">
<asp:TextBox ID="TextBox1" runat="server" Enabled="false"></asp:TextBox> </td>
</tr>
</table>
</td>
</tr>
<tr align="center"> <td><asp:Button ID="btnCancel" runat="server" Text="Close" /></td></tr>
</table>
</asp:Panel>
thanx shakeb (:
thx for all
<asp:TextBox ID="Txtname" runat="server" Enabled="false"></asp:TextBox>
<asp:TextBox ID="Txtemail" runat="server" Enabled="false"></asp:TextBox>
<asp:TextBox ID="Txtepass" runat="server" Enabled="false"></asp:TextBox>
like this all the textbox must have unique id u have copied the line and then paste don't do that write the code by own and on button click
{
{
lblMsg.Text = "";
try
{
if (Page.IsValid)
{
if (txtLogin.Text.Trim() == "" & txtPassword.Text.Trim() == "")
{
lblMsg.Text = "Please enter login name.";
return;
}
else if (txtLogin.Text.Trim() != "" & txtPassword.Text.Trim() == "")
{
lblMsg.Text = "Please enter password.";
return;
}
else if (txtLogin.Text.Trim() == "" & txtPassword.Text.Trim() != "")
{
lblMsg.Text = "Please enter login name.";
return;
}
Uname = txtLogin.Text.Trim();
Upassword = txtPassword.Text.Trim();
if (Uname.Length == 0)
{
lblMsg.Text = "Please enter Login Name.";
return;
}
if (Upassword.Length == 0)
{
lblMsg.Text = "Please enter password.";
return;
}
//Commented as on 20th March for the validation
//if (Uname.Length > 0)
//{
// if (Uname.Length > 25)
// {
// lblMsg.Text = "Login ID does not exceed 25 characters.";
// return;
// }
// if (Uname.Length < 4)
// {
// lblMsg.Text = "Login ID should not be less than 4 characters.";
// return;
// }
//}
// Password not to exceed 15 or lesser than 3 characters
//if (Upassword.Length > 0)
//{
// if (Upassword.Length < 3)
// {
// lblMsg.Text = "Password should not be less than 3 characters.";
// return;
// }
// if (Upassword.Length > 15)
// {
// lblMsg.Text = "Password should not be greater than 15 characters.";
// return;
// }
//}
System.Data.SqlClient.SqlParameter[] prm = new System.Data.SqlClient.SqlParameter[2];
prm[0] = new System.Data.SqlClient.SqlParameter("@user_name", Uname);
prm[1] = new System.Data.SqlClient.SqlParameter("@password", Upassword);
qry = "SELECT UserLoginId,UserFName,UserEmailId, Password, UserType,UserLogin FROM tblMasterUser where UserLogin=@user_name and Password=@password and UserActive=1";
dslogin = SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, qry, prm);
if (dslogin.Tables[0].Rows.Count > 0)
{
if ((txtLogin.Text.Trim()).ToString() == (dslogin.Tables[0].Rows[0]["UserLogin"]).ToString())
{
}
else
{
lblMsg.Text = "Incorrect Login Name.";
return;
}
if ((txtPassword.Text.Trim()).ToString() == (dslogin.Tables[0].Rows[0]["Password"]).ToString())
{
}
else
{
lblMsg.Text = "Incorrect Password.";
return;
}
if (dslogin.Tables[0].Rows[0]["UserType"].ToString().Trim() != "5")
{
Session["UserFName"] = dslogin.Tables[0].Rows[0]["UserFName"];
Session["UserLoginId"] = dslogin.Tables[0].Rows[0]["UserLoginId"];
Session["UserEmailId"] = dslogin.Tables[0].Rows[0]["UserEmailId"];
Session["UserType"] = dslogin.Tables[0].Rows[0]["UserType"];
}
else
{
Session["UserFName"] = dslogin.Tables[0].Rows[0]["UserFName"];
Session["UserLoginId"] = dslogin.Tables[0].Rows[0]["UserLoginId"];
Session["UserEmailId"] = dslogin.Tables[0].Rows[0]["UserEmailId"];
Session["UserType"] = dslogin.Tables[0].Rows[0]["UserType"];
string FeatchHotel= "SELECT DISTINCT hm.HotelID, hm.HotelName + ', ' + RTRIM(LTRIM(mc.CityName)) AS HotelName FROM tblMasterHotel AS hm INNER JOIN tblMasterCity AS mc ON hm.CityID = mc.CityId INNER JOIN" +
" LogInMasterSubTable ON hm.HotelID = LogInMasterSubTable.HotelID WHERE (hm.Active = 1) AND (mc.CityActive = 1) and LogInMasterSubTable.UserLoginID=" + Convert.ToInt32(Session["UserLoginId"].ToString().Trim()) + "";
DataSet result = SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, FeatchHotel);
Session["UserHotelID"]= result.Tables[0].Rows[0]["HotelID"].ToString().Trim();
Session["UserHotelName"] = result.Tables[0].Rows[0]["HotelName"].ToString().Trim();
}
qry = "Update tblMasterUser set UserLastLoggedOn=getdate() where UserLoginId=" + dslogin.Tables[0].Rows[0]["UserLoginId"];
try
{
Int32 result = (Int32)SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.Text, qry);
if (result > 0)
{
}
}
catch (Exception ex)
{
// clsException.clsHandleException.fncHandleException(ex, "Fortune");
clsException.clsHandleException.fncHandleException(ex, "Fortune");
}
Response.Redirect("main.aspx");
}
else
{
lblMsg.Text = "Incorrect Login or Password.";
txtLogin.Text = "";
txtPassword.Text = "";
}
}
}
catch (Exception ex)
{
clsException.clsHandleException.fncHandleException(ex, "Fortune");
}
finally
{
if ((dslogin != null))
{
dslogin = null;
}
}
}
}
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.