|
First google result has some possible fixes, https://stackoverflow.com/questions/2190361/cannot-get-iis-pickup-directory
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
I have a foreach statement. When I run my code in debug mode, I am getting the following error. I am not sure how to fix it. Google search shows may ways of doing it.
Error:
'object' does not contain a definition for 'Value' and no accessible method 'Value' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
My code behind
foreach(string caseNumber in userEnteredCaseNumberList)
{
EditCandidateCaseModel newCandidate = new EditCandidateCaseModel();
newCandidate.CaseNbr = caseNumber;
newCandidate.RequestorInfoID = requestorItem.Value;
newCandidate.BatchNumber = newBatchNumber;
newCandidate.EntryStaffUserName = this._loggedInUserName;
await CandidateCaseController.PostCandidate(newCandidate);
}
|
|
|
|
|
requestorItem does not have a property named Value. That's all the error is telling you.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
I am writing a small example of Login webSite, there are two types of accounts and passwords, one is an account and password is stored in the Web.config file and the other two accounts and passwords are saved in SQL Server database, My problem is that in form 1, when logging in it opens Logon_Redirect.aspx file but cannot access, the following is my code
I am debugging and running to the code where this opens the Logon_Redirect.aspx file but nothing, but when I log in with another account and password (the user password of SQL Server) log in well.
In file Web.config
<appSettings>
...
<add key="SmtpServer" value="localhost"/>
<add key="EmailWebmaster" value="admin"/>
<add key="Password" value="123"/>
...
</appSettings>
In file Logon_Redirect.aspx
...
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
In file Logon_Redirect.aspx.cs
...
public partial class Logon_Redirect : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Page.User.IsInRole(Globals.Settings.AppRoles.KhachHang))
Response.Redirect(Globals.ApplicationPath);
else if (Page.User.IsInRole(Globals.Settings.AppRoles.Admin))
Response.Redirect(Globals.ApplicationPath + "WebMaster/Contacts/Contact.aspx");
}
}
In file Logon.aspx.cs
protected void btLogon_Click(object sender, EventArgs e)
{
if (Membership.ValidateUser(txtEmail.Text, txtPassword.Text))
{
if (Request.QueryString["ReturnUrl"] != null)
{
FormsAuthentication.RedirectFromLoginPage(txtEmail.Text, false);
}
else
{
FormsAuthentication.SetAuthCookie(txtEmail.Text, false);
Session["username"] = txtEmail.Text.Trim();
Response.Redirect(Globals.ApplicationPath + "Logon_Redirect.aspx");
}
}
else
{
if (webapp4U.BOL.User.CheckUserName(txtEmail.Text) && txtPassword.Text == ConfigurationManager.AppSettings["Password"].ToString())
{
FormsAuthentication.SetAuthCookie(txtEmail.Text, false);
Session["username"] = txtEmail.Text.Trim();
Response.Redirect(Globals.ApplicationPath + "Logon_Redirect.aspx");
}
else
lblMsg.Text = ResourceManager.GetString("Logon_False");
}
}
|
|
|
|
|
I am not sure what you want us to do. You have to debug this, we can't do it for you.
And in case you do not know, storing passwords in the web.config is not a good idea nor storing them in the db either. You should store hashes, but that's another topic for another time.
Social Media - A platform that makes it easier for the crazies to find each | | | |