Log In Control with Ajax
-
Hi friends! I am very new to Ajax. I want to use ajax in my website for making intrective;During Ajax I faced some problem ;Plz give me right direction. Problem: I have used the Login Control for Authenticatin.My Authentication function is working well; But for authentication full webpage is going to Refresh. I want to authenticate but without the full webpage refresh. Means by using the Ajax authentication should be done without full webpage refresh. Code:
ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table bordercolor="#990000">
<tr>
<td bgcolor="#990000" colspan="4" style="height: 12px">
<span style="font-size: 11pt; font-family: Tahoma"><strong> <span style="font-size: 10pt"><span
style="color: #ffffff">Utility<span> Login</span></span></span></strong></span></td>
</tr>
<tr>
<td style="width: 79px; height: 29px">
<span style="font-size: 10pt; font-family: Verdana">User ID</span></td>
<td style="width: 92px; height: 29px">
<asp:TextBox ID="txtuid" runat="server" Height="15px" Width="100px"></asp:TextBox></td>
<td colspan="2" style="width: 3px; height: 29px">
<asp:Label ID="Label3" runat="server" ForeColor="Red" Text="*" Visible="False"></asp:Label></td>
</tr>
<tr style="font-size: 10pt; color: #000000; font-family: Verdana">
<td style="width: 79px">
<span><span>Password</span></span -
Hi friends! I am very new to Ajax. I want to use ajax in my website for making intrective;During Ajax I faced some problem ;Plz give me right direction. Problem: I have used the Login Control for Authenticatin.My Authentication function is working well; But for authentication full webpage is going to Refresh. I want to authenticate but without the full webpage refresh. Means by using the Ajax authentication should be done without full webpage refresh. Code:
ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table bordercolor="#990000">
<tr>
<td bgcolor="#990000" colspan="4" style="height: 12px">
<span style="font-size: 11pt; font-family: Tahoma"><strong> <span style="font-size: 10pt"><span
style="color: #ffffff">Utility<span> Login</span></span></span></strong></span></td>
</tr>
<tr>
<td style="width: 79px; height: 29px">
<span style="font-size: 10pt; font-family: Verdana">User ID</span></td>
<td style="width: 92px; height: 29px">
<asp:TextBox ID="txtuid" runat="server" Height="15px" Width="100px"></asp:TextBox></td>
<td colspan="2" style="width: 3px; height: 29px">
<asp:Label ID="Label3" runat="server" ForeColor="Red" Text="*" Visible="False"></asp:Label></td>
</tr>
<tr style="font-size: 10pt; color: #000000; font-family: Verdana">
<td style="width: 79px">
<span><span>Password</span></spankushMuchaal wrote:
I have used the Login Control for Authenticatin
Where is your login control?
-
Hi friends! I am very new to Ajax. I want to use ajax in my website for making intrective;During Ajax I faced some problem ;Plz give me right direction. Problem: I have used the Login Control for Authenticatin.My Authentication function is working well; But for authentication full webpage is going to Refresh. I want to authenticate but without the full webpage refresh. Means by using the Ajax authentication should be done without full webpage refresh. Code:
ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table bordercolor="#990000">
<tr>
<td bgcolor="#990000" colspan="4" style="height: 12px">
<span style="font-size: 11pt; font-family: Tahoma"><strong> <span style="font-size: 10pt"><span
style="color: #ffffff">Utility<span> Login</span></span></span></strong></span></td>
</tr>
<tr>
<td style="width: 79px; height: 29px">
<span style="font-size: 10pt; font-family: Verdana">User ID</span></td>
<td style="width: 92px; height: 29px">
<asp:TextBox ID="txtuid" runat="server" Height="15px" Width="100px"></asp:TextBox></td>
<td colspan="2" style="width: 3px; height: 29px">
<asp:Label ID="Label3" runat="server" ForeColor="Red" Text="*" Visible="False"></asp:Label></td>
</tr>
<tr style="font-size: 10pt; color: #000000; font-family: Verdana">
<td style="width: 79px">
<span><span>Password</span></spanSo what issues/problems are you having? IMO login should not be done via ajax. The initial page should display only publicly accessible information, after authentication the user should be redirected to secured content.
I know the language. I've read a book. - _Madmatt
-
kushMuchaal wrote:
I have used the Login Control for Authenticatin
Where is your login control?
arun$aini wrote:
Where is your login control?
Probably all that stuff we call html and server control tags, like textbox and button. :rolleyes:
I know the language. I've read a book. - _Madmatt
-
So what issues/problems are you having? IMO login should not be done via ajax. The initial page should display only publicly accessible information, after authentication the user should be redirected to secured content.
I know the language. I've read a book. - _Madmatt
Thanks for gving interest in my problem; Language: C# with Asp.net using AJAX After using the update panel including authentication Table(userName,Password)the following error occur; Wats the reason for this Error; Sys.WebForm.PageRequestManagerParserErrorException:THis msg recieved from the server could not be parsed.Common cause for this error are when the response is modified by calls to Response.Write(), response filters,HttpModules.or server trace is Enabled. Details:Erro parsing near' |<html> <Head> '.
-
Thanks for gving interest in my problem; Language: C# with Asp.net using AJAX After using the update panel including authentication Table(userName,Password)the following error occur; Wats the reason for this Error; Sys.WebForm.PageRequestManagerParserErrorException:THis msg recieved from the server could not be parsed.Common cause for this error are when the response is modified by calls to Response.Write(), response filters,HttpModules.or server trace is Enabled. Details:Erro parsing near' |<html> <Head> '.
Have you made sure the httpmodules for ajax have been added to the web.config?
I know the language. I've read a book. - _Madmatt
-
arun$aini wrote:
Where is your login control?
Probably all that stuff we call html and server control tags, like textbox and button. :rolleyes:
I know the language. I've read a book. - _Madmatt
I thought he was talking about the asp.net login control. :~
-
Have you made sure the httpmodules for ajax have been added to the web.config?
I know the language. I've read a book. - _Madmatt
Yes Sir I have already Added to the webconfig.
-
Hi friends! I am very new to Ajax. I want to use ajax in my website for making intrective;During Ajax I faced some problem ;Plz give me right direction. Problem: I have used the Login Control for Authenticatin.My Authentication function is working well; But for authentication full webpage is going to Refresh. I want to authenticate but without the full webpage refresh. Means by using the Ajax authentication should be done without full webpage refresh. Code:
ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table bordercolor="#990000">
<tr>
<td bgcolor="#990000" colspan="4" style="height: 12px">
<span style="font-size: 11pt; font-family: Tahoma"><strong> <span style="font-size: 10pt"><span
style="color: #ffffff">Utility<span> Login</span></span></span></strong></span></td>
</tr>
<tr>
<td style="width: 79px; height: 29px">
<span style="font-size: 10pt; font-family: Verdana">User ID</span></td>
<td style="width: 92px; height: 29px">
<asp:TextBox ID="txtuid" runat="server" Height="15px" Width="100px"></asp:TextBox></td>
<td colspan="2" style="width: 3px; height: 29px">
<asp:Label ID="Label3" runat="server" ForeColor="Red" Text="*" Visible="False"></asp:Label></td>
</tr>
<tr style="font-size: 10pt; color: #000000; font-family: Verdana">
<td style="width: 79px">
<span><span>Password</span></spanWhat code you have written on Button1_Click1 event?
-
What code you have written on Button1_Click1 event?
I have used this code;
protected void Button1_Click1(object sender, EventArgs e)
{string str = "select \* from userlogin where userid='" + this.txtuid.Text + "' and password='" + this.txtpassword.Text + "'"; OracleDataReader dr = dms\_obj.GetDataReader(str); if (dr.Read()) { Session\["username"\] = txtuid.Text; string sess = Convert.ToString(Session\["username"\]); Session\["password"\] = txtpassword.Text; string pass = Session\["password"\].ToString(); Label1.Visible = true; Label1.Text = "Authentication Success"; txtuid.Text = ""; txtpassword.Text = ""; } else { //Alert("Invalid User name/Password"); Label1.Text = "InValid UserName/Password"; txtuid.Text = ""; txtpassword.Text = ""; } }
-
Yes Sir I have already Added to the webconfig.
I'd go with my original response, you are gaining nothing in the login process by trying to use AJAX.
I know the language. I've read a book. - _Madmatt
-
I have used this code;
protected void Button1_Click1(object sender, EventArgs e)
{string str = "select \* from userlogin where userid='" + this.txtuid.Text + "' and password='" + this.txtpassword.Text + "'"; OracleDataReader dr = dms\_obj.GetDataReader(str); if (dr.Read()) { Session\["username"\] = txtuid.Text; string sess = Convert.ToString(Session\["username"\]); Session\["password"\] = txtpassword.Text; string pass = Session\["password"\].ToString(); Label1.Visible = true; Label1.Text = "Authentication Success"; txtuid.Text = ""; txtpassword.Text = ""; } else { //Alert("Invalid User name/Password"); Label1.Text = "InValid UserName/Password"; txtuid.Text = ""; txtpassword.Text = ""; } }
string str = "select * from userlogin where userid='" + this.txtuid.Text + "' and password='" + this.txtpassword.Text + "'";
Unvalidated user input placed directly into inline SQL? :omg: What's the point of having a login? Have you ever heard of SQL Injection attacks?
Session["password"] = txtpassword.Text;
NEVER, EVER store a password in memory!!
Session["username"] = txtuid.Text;
string sess = Convert.ToString(Session["username"]);
Session["password"] = txtpassword.Text;
string pass = Session["password"].ToString();This is useless code. Put the text to Session variable then the Session variable to a local variable. :wtf: You don't even use the local variables.
I know the language. I've read a book. - _Madmatt