|
First he should go here[^] and mark the content he wants to have printed.
I need a perfect, to the point answer as I am not aware of this.
Please don't reply explaining what method overloading is
|
|
|
|
|
|
then you should ask in the message board below the article.
That way the author get a notification and possible an email too.
If he still maintains the article, you will get better answer there than here.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
So help me out for it i will send you code
html page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="login" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<ul class="selfText">
<li> <asp:Label ID="Label1" runat="server" Width="90px" Text=" User Name:"> </asp:Label>
<asp:TextBox ID="txtusername" runat="server" placeholder="User Name"></asp:TextBox> </li>
<li> <asp:Label ID="Label2" runat="server" Width="90px" Text=" Password:"></asp:Label>
<asp:TextBox ID="txtPassword" runat="server" placeholder="Password"></asp:TextBox> </li>
<br />
<li> <asp:CheckBox ID="CheckBox1" runat="server" Text="Remember Me"/>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</li>
</ul><div style=" clear:both"></div>
<asp:Label id="ErrorLabel" runat="Server" ForeColor="Red"
Visible="false"/>
</div>
</form>
</body>
</html>
code behind it
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Security.Principal;
public partial class login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
FormsAuthentication.Initialize();
String cs = ConfigurationManager.ConnectionStrings["connect"].ConnectionString;
SqlConnection con = new SqlConnection(cs);
SqlCommand cmd = new SqlCommand("role1", con);
cmd.CommandType = CommandType.StoredProcedure;
con.Open();
cmd.Parameters.AddWithValue("@UserName", txtusername.Text);
cmd.Parameters.AddWithValue("@Password", txtPassword.Text);
FormsAuthentication.HashPasswordForStoringInConfigFile(
txtPassword.Text, "md5");
SqlDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, txtusername.Text, DateTime.Now, DateTime.Now.AddMinutes(30),
true, reader.GetString(0), FormsAuthentication.FormsCookiePath);
string hash = FormsAuthentication.Encrypt(ticket);
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, hash);
if (ticket.IsPersistent) cookie.Expires = ticket.Expiration;
Response.Cookies.Add(cookie);
string returnUrl = Request.QueryString["ReturnUrl"];
if (returnUrl == null) returnUrl = "/";
Response.Redirect("~/administrators/Welcome.aspx");
}
else
{
ErrorLabel.Text = "Username / password incorrect. Please try again.";
ErrorLabel.Visible = true;
}
reader.Close();
con.Close();
}
}
i make folder name user
and its wen cong.
<?xml version="1.0"?>
<configuration>
<system.web>
<authorization>
<!-- Order and case are important below -->
<allow roles="user"/>
<deny users="*"/>
</authorization>
</system.web>
</configuration>
user page in folder html code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="userpage.aspx.cs" Inherits="users_userpage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2>Welcome to user page</h2>
<asp:HyperLink id="AdminLink" runat="server"
Text="Users, click here." NavigateUrl="~/users/"/>
</div>
</form>
</body>
</html>
code of html of user
protected void Page_Load(object sender, EventArgs e)
{
if (User.IsInRole("user"))
AdminLink.Visible = true;
}
main web cong.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http:
-->
<configuration>
<connectionStrings>
<add name="connect" connectionString="Database=Test; server=.; uid=sa ;pwd=1234" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="Forms">
<forms loginUrl="login.aspx" protection="All" path="/"/>
</authentication>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
<location path="administrators">
<system.web>
<authorization>
<!-- Order and case are important below -->
<allow roles="Admin"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<location path="users">
<system.web>
<authorization>
<!-- Order and case are important below -->
<allow roles="user"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
</configuration>
|
|
|
|
|
Absolutely the wrong place for this: see the bit in red at the top of the page.
Ask here: Ask a question[^]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
Look at the top of this page: there is a bit in red which gives you explicit instructions that this forum is not for programming questions. That's a rule: and it applies to you, just like it applies to everyone else.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
This is the Lounge and not for programming questions. Please do as advised or choose the correct forum for the problem subject.
|
|
|
|
|
this validate only folder not in files.
|
|
|
|
|
I guess no one taught you how to read.
|
|
|
|
|
So u can teach me by solving ,my problem
|
|
|
|
|
|
so thats mean you are not a developer
|
|
|
|
|
No, that means either you can't read the instructions at the top of this forum OR you're willfully ignoring what you're being told.
|
|
|
|
|
This sure looks to me like some (substandard) AI driven chat-bot
modified 19-Nov-18 21:01pm.
|
|
|
|
|
More like Artificial Stupidity.
|
|
|
|
|
As the article is 8 years old and Heath has not posted in 3 years I doubt you are going to get a video out of him.
Why do you assume there is a video? It is a terrible way of learning.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It's not just that the article is 8 years old,
Quote: Updated: With ASP.NET 2.0, Microsoft introduced built-in support for role membership. If you're using ASP.NET 2.0 or newer it's recommended you read Managing Authorization using Roles on MSDN. You can use an abstract data provider or create your own. This article was written for ASP.NET 1.0 but will also work for 1.1.
... this has been obsolete since .net 2.0 provided a build in implementation. Since the 1.x framework hasn't received security patches in a number of years I strongly hope the OP's inability to read means he's trying to use an obsolete implementation on a modern framework; and isn't trying to build something on 1.x today.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
There is no video, or almost certainly not. You can ask the author - there is a forum for comments and questions at the bottom of the article that will cause an email to be sent to him - but the article is eight years old, and the author hasn't logged in for over a year.
And why do you assume that a video must exist? A video is a bad way to learn: you can't even copy and paste code from a video to try it out, and it's extremely boring watching someone type, correct, type, compile, swear, edit, ...
Read the text: coding videos are mostly made by people with little or no grasp of what they are doing (video is a great way to hide your incompetence in a layer of polish). If it helps you, good. If it doesn't, read it again. If that still doesn't work, try a different one.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You're not going to get a video for this article.
Heath moved on to Microsoft since that article was written and is way too busy to spend about a hundred hours of work that it's going to take to make a video on this just for you.
Besides, you'll get far LESS information in the video that you will in a written article.
|
|
|
|
|
and I want 1 million dollars. I face difficulty implementing buying a Ferrari.
modified 20-Oct-19 21:02pm.
|
|
|
|
|
Glen Campbell Dead at 81 | TMZ.com[^]
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
|
I watched the CNN special last year about his final tour while trying to deal with his disease - tough.
I was just a small boy when I first heard Glen Campbell Rhinestone Cowboy - YouTube[^]. Didn't understand the words back then, but I have liked the song ever since.
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
Here he is with Willie Nelson
I first read the text in the title as "Terrible guitar break" - until I heard the song and realized that that couldn't possibly be right! Glen is really good on the guitar!
RIP Glen!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|