i tried both solutions but didn't work. here is my code:
protected void btnSignin_Click(object sender, EventArgs e)
{
txtIDNumber.BorderStyle = BorderStyle.None;
txtIDNumber.ForeColor = System.Drawing.Color.Red;
txtIDNumber.ReadOnly = true;
txtPassword.BorderStyle = BorderStyle.None;
txtPassword.ForeColor = System.Drawing.Color.Red;
txtPassword.ReadOnly = true;
rowButtons.Visible = false;
sql_connection = new SqlConnection("Data Source=.\\SQLEXPRESS;initial catalog=ahlanbahrain.com;integrated security=true");
// sql_connection = new SqlConnection(ConfigurationManager.ConnectionStrings["website_connectionstring"].ToString());
sql_connection.Open();
sql_command = new SqlCommand("sp_get_member_profile", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
sql_command.Parameters.Add("@member_cpr", SqlDbType.VarChar).Value = txtIDNumber.Text;
sql_command.Parameters.Add("@member_password", SqlDbType.VarChar).Value = txtPassword.Text.ToLower();
// SqlParameter retrun_cpr = new SqlParameter("@member_cpr", SqlDbType.VarChar);
// retrun_cpr.Direction = ParameterDirection.ReturnValue;
// SqlParameter retrun_email = new SqlParameter("@member_email", SqlDbType.VarChar);
// retrun_email.Direction = ParameterDirection.ReturnValue;
// SqlParameter retrun_password = new SqlParameter("@member_password", SqlDbType.VarChar);
// retrun_password.Direction = ParameterDirection.ReturnValue;
sql_reader = sql_command.ExecuteReader();
if (sql_reader.Read())
{
// while (sql_reader.Read())
// {
Application["member_cpr"] = sql_reader["member_cpr"].ToString();
Application["member_email"] = sql_reader["member_email"].ToString();
Application["member_password"] = sql_reader["member_password"].ToString();
Application["member_is_loggedon"] = true;
sql_connection.Close();
Response.Redirect("member.aspx");
// }
}
else
{
Application["member_is_loggedon"] = false;
Application["message_title"] = "نأسف!!";
Application["message_text"] = "لم يتم العثور على حسابك الخاص بالبيانات التي ذكرتها. يرجى الضغط على زر الرجوع للتأكد من بياناتك.!!";
Application["link_1_text"] = "الصفحة الرئيسية";
Application["link_1_url"] = "Default.aspx";
Application["link_2_text"] = "اتصل بنا";
Application["link_2_url"] = "contact.aspx";
Response.Redirect("message.aspx?id=" + txtIDNumber.Text + "&cc=" + txtPassword.Text);
}
}
and this is my ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="signin.aspx.cs" Inherits="signin" %>
<%@ Register TagPrefix="ucl" TagName="ucl_website_header" Src="~/website_header.ascx" %>
<%@ Register TagPrefix="ucl" TagName="ucl_website_menu" Src="~/website_menu.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html id="Html1" xmlns="http://www.w3.org/1999/xhtml" runat="server" dir="rtl" lang="ar-bh" >
<head id="Head1" runat="server" dir="rtl" lang="ar-bh">
<meta name="robots" content="INDEX,FOLLOW" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link href="website_stylesheet.css" rel="Stylesheet" type="text/css"/>
<meta name="keywords" content="Jassim Rahma, AlRahma, جاسم رحمة, جاسم آل رحمة, البحرين, الشيعة, آل خليفة, السياسة, الإعلام, الصحة, آل رحمة" />
<title>AhlanBahrain.com - sign in</title>
</head>
<body id="Body1" runat="server" dir="rtl" lang="ar-bh" style="margin: 5" >
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
<asp:Table ID="Table1" runat="server" Width="779" HorizontalAlign="Center" BorderStyle="None" CellPadding="0" CellSpacing="0">
<asp:TableRow><asp:TableCell Width="100%"><ucl:ucl_website_header ID="website_header" runat="server" /></asp:TableCell></asp:TableRow>
<asp:TableRow><asp:TableCell Width="100%"><ucl:ucl_website_menu ID="Ucl_website_menu" runat="server" /></asp:TableCell></asp:TableRow>
<asp:TableRow>
<asp:TableCell Width="100%">
<asp:UpdatePanel ID="updatepanelSignin" UpdateMode="Always" runat="server">
<ContentTemplate>
<asp:Table ID="Table3" runat="server" HorizontalAlign="Center" BorderStyle="None" CellPadding="0" CellSpacing="0">
<asp:TableRow ID="TableRow1"><asp:TableCell ColumnSpan="3"><strong>الدخول إلى صفحتك الخاصة:</strong><br /></asp:TableCell></asp:TableRow>
<asp:TableRow ID="rowError" Visible="false"><asp:TableCell ColumnSpan="3"><br /><asp:Label runat="server" ID="lblError" Font-Bold="true" ForeColor="Red"></asp:Label><br /></asp:TableCell></asp:TableRow>
<asp:TableRow><asp:TableCell ColumnSpan="3"><br /></asp:TableCell></asp:TableRow>
<asp:TableRow>
<asp:TableCell HorizontalAlign="Right" VerticalAlign="Top">الرقم الشخصي</asp:TableCell>
<asp:TableCell HorizontalAlign="Right" VerticalAlign="Top"> : </asp:TableCell>
<asp:TableCell HorizontalAlign="Right" VerticalAlign="Top"><div dir="ltr"><asp:TextBox runat="server" TextMode="SingleLine" ID="txtIDNumber" MaxLength="9" Width="200"></asp:TextBox></div></asp:TableCell>
</asp:TableRow>
<asp:TableRow><asp:TableCell ColumnSpan="3"><br /></asp:TableCell></asp:TableRow>
<asp:TableRow>
<asp:TableCell HorizontalAlign="Right" VerticalAlign="Top">كلمة السر</asp:TableCell>
<asp:TableCell HorizontalAlign="Right" VerticalAlign="Top"> : </asp:TableCell>
<asp:TableCell HorizontalAlign="Right" VerticalAlign="Top"><div dir="ltr"><asp:TextBox runat="server" TextMode="Password" ID="txtPassword" MaxLength="12" Width="200"></asp:TextBox></div></asp:TableCell>
</asp:TableRow>
<asp:TableRow><asp:TableCell ColumnSpan="3"><br /></asp:TableCell></asp:TableRow>
<asp:TableRow ID="rowButtons">
<asp:TableCell HorizontalAlign="Center" ColumnSpan="3" VerticalAlign="Top">
<asp:Button runat="server" ID="btnSignin" Text=" دخول " Width="100" OnClick="btnSignin_Click" /> <asp:Button runat="server" ID="btnSignup" Text=" مشترك جديد " Width="100" PostBackUrl="~/signup.aspx" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell HorizontalAlign="Center" VerticalAlign="Middle" ColumnSpan="3">
<asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="updatepanelSignin" runat="server">
<ProgressTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/loading_progress.gif" />
</ProgressTemplate>
</asp:UpdateProgress>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSignin" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</form>
</body>
</html>