TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vindhya Yadaav
NA
36
10.6k
Login data to store in session how???
Oct 19 2016 7:18 AM
@{<br /> <br /> Page.Title = "Log in";<br /> if (IsPost && Validation.IsValid()) {<br /> var email = Request.Form["email"];<br /> var password = Request.Form["password"];<br /> var db = Database.Open("studentcareer");<br /> var result = db.QueryValue("SELECT Count(*) FROM Account WHERE Loginid = @0 AND Password = @1", email, password);<br /> //var result = db.Query("SELECT * FROM Account WHERE Loginid = @0 AND Password = @1", email, password);<br /> if (result > 0){<br /> <br /> Session["a"]= Request.Form["email"];<br /> Response.Redirect("~/HomePage22.cshtml");<br /> } <br /> }<br />}<br /><br /><html> <br /><head><br /> <meta charset="utf-8" /><br /> <title></title><br /> <br /> </head><br /> <body><br /><br /> <br /> <form name="login" action="" method="post" accept-charset="utf-8"> <br /> <table border="1"><br /> <tr><br /> <td><br /> <br /> <label for="email">Email</label></td><td><br /> <input type="email" name="email" placeholder="
[email protected]
" required value = "@Request.Form["email"]"></td> </tr><br /> <tr> <td><label for="password">Password</label> </td><br /> <td> <input type="password" name="password" placeholder="Password" required> </td><br /> </tr><br /> <tr> <td> <a href="/PageRagistration.cshtml" target=" _blank"> New Ragistration</a> </td><td><input type="submit" value="Login"> </td></tr><br /> <br /> <br /> </table><br /> </form><br /> </body><br /><div></html> </div><div> </div><div><strong><span style="color: red;"> login page coding after coding open page</span></strong></div><div> <img src="/forums/uploadfile/7e7d0c/10192016065835AM/after login.jpg" alt="" height="454" width="606" border="0" /></div><div> <pre style="font-family:Consolas;font-size:10pt;color:black;background:white;"><span style="color:#222222;background:#d7bf49;"><br /></span><span style="color:#222222;"></span></pre>@{<br /> var db = Database.Open("studentcareer");<br /> <strong><span style="color: red;">var selectQueryString = "SELECT * FROM webinfo where Loginid=@Session["a"].Tostring()"; <span style="color: #3366ff;">(</span> <span style="color: #3366ff;">how to</span> <span style="color: #3366ff;">Displ</span><span style="color: #3366ff;">ay </span><span style="color: #3366ff;">Session store data only???)</span></span></strong><br /> <br /> }<br />@RenderPage("PageHeader.cshtml")<br /><br /><!DOCTYPE html><br /><html><br /> <head><br /> <title>Data information</title><br /> <style><br /> table, th, td {<br /> border: solid 1px #bbbbbb;<br /> border-collapse: collapse;<br /> padding: 2px;<br /> background: #f1f1f1;<br /> }<br /> </style><br /> </head><br /> <body><br /> <br /> <div class="Center "> <br /> <h1>View your Data</h1><br /> <table><br /> <thead><br /> <br /> <tr><br /> <th>S.No.</th><br /> <th>Webpath</th><br /> <th>Login</th><br /> <th>Password</th><br /> <th>Remarks</th><br /> <th>Crdate</th><br /> <th>Examdate</th><br /> <th>LoginId</th><br /> <th>thought</th><br /> </tr><br /> </thead><br /> <tbody><br /> @foreach(var row in db.Query(selectQueryString))<br /> {<br /> <tr><br /> <br /> <td>@row.Sno</td><br /> <td>@row.Webpath</td><br /> <td>@row.Login</td><br /> <td>@row.Password</td><br /> <td>@row.Remarks</td><br /> <td>@row.Crdate</td><br /> <td>@row.Examdate</td><br /> <td>@row.LoginId</td><br /> <td>@row.thought</td><br /> </tr><br /> }<br /> </tbody><br /> </table><br /> </div><br /> </body><br /></html><br />@RenderPage("PageFooter.cshtml")<p> </p></div>
Reply
Answers (
2
)
I need to find out the one item width and dimensions
Retrieve value from array class