| | |
help me pls.. tml 10 more hours to due date..!!
Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Aug 2007
Posts: 4
Reputation:
Solved Threads: 0
can anyone show me to login page code?? i did my registration code already.. now i need the login page the userid and pword read from my database access then the user can log in to another page.. i need the whole code. as simple as possible.. thankyou very much. this is my asp.net assignment.. im very weak in asp.net.. pls help.. tq.. im doing dvd rental assignment..
im using asp.net 1.1 and microsoft access 2003
im using asp.net 1.1 and microsoft access 2003
Last edited by gminghon; Aug 20th, 2007 at 12:58 pm.
Use this code
<script runat="server">
void button_click(Object s, EventArgs e)
{
if (ds_user.RecordCount == 1)
{
Response.Cookies["ckuser"].Value = txtusername.Text;
Response.Cookies["ckuser"].Expires = DateTime.Now.AddDays(1);
Response.Redirect("home.aspx");
}
}
</script>
You can fill the Dataset "ds_user" with this valid user check result. This will have 1 record if the username and password matches
<script runat="server">
void button_click(Object s, EventArgs e)
{
if (ds_user.RecordCount == 1)
{
Response.Cookies["ckuser"].Value = txtusername.Text;
Response.Cookies["ckuser"].Expires = DateTime.Now.AddDays(1);
Response.Redirect("home.aspx");
}
}
</script>
You can fill the Dataset "ds_user" with this valid user check result. This will have 1 record if the username and password matches
Query to validate the user name and password is:
SELECT user_id, user_name, user_pwd
FROM tbl_users
WHERE user_name = @user_name AND user_pwd = @userpwd
You can also use the windows authentication by using (AuthenticatioMode = Windows) in app.config file
SELECT user_id, user_name, user_pwd
FROM tbl_users
WHERE user_name = @user_name AND user_pwd = @userpwd
You can also use the windows authentication by using (AuthenticatioMode = Windows) in app.config file
•
•
Join Date: Aug 2007
Posts: 4
Reputation:
Solved Threads: 0
omg... i dun understand.. but wat i wan is the userid and pword textbox is read from my microsoft access database..let say my database name user_details.mdb
if userid and pword match wif access database redirect to home.aspx if not match error.. wait should i do?? i really dunno how to code this login page... can teach me step by step? or create the login page for me??
if userid and pword match wif access database redirect to home.aspx if not match error.. wait should i do?? i really dunno how to code this login page... can teach me step by step? or create the login page for me??
It does not matter what Database your are using. Even if you are using the logic will remain the same. But the only thing that would change is the Database connection string. You can use OLE_DB to connect to the Access Database and then do the rest of the task.
Connection string would be something like this for Access:
Dim strConn as string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath "user_details.mdb") & ";"
Connection string would be something like this for Access:
Dim strConn as string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath "user_details.mdb") & ";"
•
•
Join Date: Aug 2007
Posts: 4
Reputation:
Solved Threads: 0
so the code should be
urm the top should
import.xxxx
<script runat="server">
Dim strConn as string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath "user_details.mdb") & ";"
void button_click(Object s, EventArgs e)
{
if (ds_user.RecordCount == 1)
{
Response.Cookies["ckuser"].Value = txtusername.Text;
Response.Cookies["ckuser"].Expires = DateTime.Now.AddDays(1);
Response.Redirect("home.aspx");
}
}
</script>
like this???
urm the top should
import.xxxx
<script runat="server">
Dim strConn as string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath "user_details.mdb") & ";"
void button_click(Object s, EventArgs e)
{
if (ds_user.RecordCount == 1)
{
Response.Cookies["ckuser"].Value = txtusername.Text;
Response.Cookies["ckuser"].Expires = DateTime.Now.AddDays(1);
Response.Redirect("home.aspx");
}
}
</script>
like this???
yes and then you need to open the Dataset also when the users clicks on submit. ie; "ds_user"
For web applications it is recommended to use Data Readers instead of Data Sets.
For web applications it is recommended to use Data Readers instead of Data Sets.
![]() |
Similar Threads
- What's the HARDEST program you've written? (Computer Science)
- i m lost pls help (Pascal and Delphi)
- Question regarding customizing default task form in Outlook 2003 (Windows Software)
- C++ help for a newbie (C++)
- Reading data into files (C++)
- Please hel me.....is urgent!!! (C++)
- Max and Min values from a group of numbers (C++)
- Converting Struct to class lost with pointers (C++)
- Pythagorean Triples (C)
- Operating Systems assignment (C++)
Other Threads in the ASP.NET Forum
- Previous Thread: synchronization, remoting, ad rotator
- Next Thread: asp.net with MYSQL
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 beginner bottomasp.net browser businesslogiclayer c# c#gridviewcolumn cac checkbox class compatible confirmationcodegeneration content contenttype countryselector courier css dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deployment development dgv dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv forms gridview gudi homeedition iframe iis javascript jquery listbox menu microsoft mouse mssql multistepregistration nameisnotdeclared news objects opera problem redirect registration relationaldatabases reportemail rotatepage schoolproject security serializesmo.table sessionvariables silverlight smartcard smoobjects software sql sql-server ssl textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visual-studio visualstudio web webapplications webarchitecture webdevelopemnt webdevelopment webprogramming





