Advertisement

01.25.2005 at 11:54AM PST, ID: 21288230
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

4.6

C#.net Custom Control Login Check namespace

Asked by j_tipps in .NET

Tags: ,

Hello,
I'm haveing a problem using a control class to verfify if someone is login and if not repsond correctly.
It can't seem to import the correct namespace for the User.Identity.IsAuthenticated.  
I'm using windows authentication.
I have read something about Page.User....no idea.

For now i have this code in regualer code behind files and it works fine.  I'm not trying to get all my reusable items together and since this is code would be in almost every page it was the first on my list :)

here is the code in the class that i'm haveing a namespace problem:

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Configuration;

namespace VenderRisk
{

      public class Common
      {
            SqlConnection Conn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
            
            public Common()
            {
                  //
                  // TODO: Add constructor logic here
                  //
            }
            public bool CheckLog()
            {
                  DataTable UserTB = new DataTable();
                  bool HowAboutIt;
                  if ((User.Identity.IsAuthenticated) & (Request.Cookies["UserInfo"] != null))      
                  {
                        HowAboutIt = true;
                        return HowAboutIt;
                  }
                  else
                  {
                        
                        SqlCommand SelRoles = new SqlCommand("SELECT   Users.RecID, Users.NTLog, Users.Fname, Users.Lname, Users.Email, Users.Phone, Users.EmpID, Users.Role, LOB.LOBID FROM  Users INNER JOIN  LOB ON Users.LOB = LOB.LOBID WHERE  (NTLog = @ID)", Conn);
                        SqlParameter Userparam  = new SqlParameter();
                        Userparam.ParameterName = "@ID";
                        Userparam.Value = User.Identity.Name.ToString();
                        SelRoles.Parameters.Add(Userparam);
                        SqlDataAdapter  FillRoles = new SqlDataAdapter(SelRoles);
                        FillRoles.Fill(UserTB);
                        if (UserTB.Rows.Count > 0)
                        {
                              HttpCookie cook = new HttpCookie("UserInfo");
                              cook.Values.Add("UserRole",UserTB.Rows[0]["Role"].ToString());
                              cook.Values.Add("LOBID", UserTB.Rows[0]["LOBID"].ToString());
                              cook.Values.Add("UserID", UserTB.Rows[0]["RecID"].ToString());
                              cook.Expires = DateTime.Now + TimeSpan.FromDays(1);
                              Response.Cookies.Add(cook);
                        }
                        else
                        {
                              Response.Redirect("http://" + Request.ServerVariables["http_host"] + "/VenderRisk/AddUsers.aspx");
                        }
                  }
            }
      }
}

Whats going on?  why wont it work? it has the correct namespace and then some!
I'm also haveing a problem with Request and Response namespaces.
I think i'm just miss understanding something.
Thanks for any help.Start Free Trial
[+][-]01.25.2005 at 11:57AM PST, ID: 13135782

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.25.2005 at 01:40PM PST, ID: 13136839

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 06:06AM PST, ID: 13141888

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 06:11AM PST, ID: 13141930

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: .NET
Tags: http_host, namespace
Sign Up Now!
Solution Provided By: sumo_the_cat
Participating Experts: 2
Solution Grade: A
 
 
[+][-]01.26.2005 at 06:12AM PST, ID: 13141941

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 06:16AM PST, ID: 13141994

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 06:18AM PST, ID: 13142008

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 06:21AM PST, ID: 13142040

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 06:26AM PST, ID: 13142102

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 06:30AM PST, ID: 13142151

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 06:30AM PST, ID: 13142157

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 06:40AM PST, ID: 13142273

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 06:53AM PST, ID: 13142430

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 07:18AM PST, ID: 13142750

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 07:31AM PST, ID: 13142905

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 07:41AM PST, ID: 13143016

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 07:47AM PST, ID: 13143086

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 08:00AM PST, ID: 13143257

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 08:03AM PST, ID: 13143295

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 08:10AM PST, ID: 13143384

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 08:14AM PST, ID: 13143427

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 08:47AM PST, ID: 13143861

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 08:59AM PST, ID: 13144033

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 09:08AM PST, ID: 13144125

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2005 at 10:56AM PST, ID: 13145282

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32