Click here to Skip to main content
15,880,608 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Disable a button a web form. Pin
AndieDu15-Mar-09 12:48
AndieDu15-Mar-09 12:48 
AnswerRe: Disable a button a web form. Pin
therios16-Mar-09 12:31
therios16-Mar-09 12:31 
GeneralRe: Disable a button a web form. Pin
AndieDu16-Mar-09 12:47
AndieDu16-Mar-09 12:47 
GeneralRe: Disable a button a web form. Pin
therios16-Mar-09 13:10
therios16-Mar-09 13:10 
Questiondownload works in IE but not in firefox Pin
Meax12-Mar-09 12:19
Meax12-Mar-09 12:19 
QuestionControls Are Coming Over to Calendar.... Pin
Sr...Frank12-Mar-09 11:17
Sr...Frank12-Mar-09 11:17 
AnswerRe: Controls Are Coming Over to Calendar.... Pin
Jörgen Andersson12-Mar-09 12:13
professionalJörgen Andersson12-Mar-09 12:13 
Questionloading user info after login from object Pin
liamderice12-Mar-09 9:37
liamderice12-Mar-09 9:37 
hey there, I'm still learning C# and am having some issues with a login I've created. The login page gets the user info into an object and sets the cookie no problem. But when I go to the next page I can't seem to figure out how to get at the object I created on the login page. Here's a snippet of what I've got...

login.aspx.cs
private void cmdLogin_ServerClick(object sender, System.EventArgs e)
{
  UserDetails oUserDetails = validateUser(txtAssocNum.Value, txtUserName.Value, txtUserPass.Value);
  if (oUserDetails != null) 
  {
    //UserDetails oUserDetails = new UserDetails();
    
    Response.Cookies["UserID"].Path = "/";
    Response.Cookies["UserID"].Value = oUserDetails.UserID.ToString();
    FormsAuthentication.RedirectFromLoginPage(txtUserName.Value, chkPersistCookie.Checked);

    //oUserDetails = null;
  } 
  else {
    lblMsg.Text = "The information you provided does not match our database.";
  }
}




loadDetailsAfterLogin.aspx.cs
protected System.Web.UI.WebControls.Panel PanelMain;

private void Page_Load(object sender, System.EventArgs e)
{
  Response.Cache.SetCacheability(HttpCacheability.NoCache);

  if (!User.Identity.IsAuthenticated) 
  {
    Response.Redirect("~/Login.aspx");
  }

  UserDetails oUserDetails = new UserDetails();
  //UserDetails oUserDetails = UserDetails();

  PanelMain.Controls.Add(new LiteralControl("<table>"));
  PanelMain.Controls.Add(new LiteralControl("<tr><td>First Name : </td><td>" + oUserDetails.FirstName + "</td></tr>"));
  PanelMain.Controls.Add(new LiteralControl("<tr><td>Last Name : </td><td>" + oUserDetails.LastName + "</td></tr>"));
  PanelMain.Controls.Add(new LiteralControl("</table>"));

  oUserDetails = null;
}


Thanks in advance.
AnswerRe: loading user info after login from object Pin
Christian Graus12-Mar-09 10:04
protectorChristian Graus12-Mar-09 10:04 
GeneralRe: loading user info after login from object Pin
liamderice12-Mar-09 10:31
liamderice12-Mar-09 10:31 
GeneralRe: loading user info after login from object Pin
Jörgen Andersson12-Mar-09 12:11
professionalJörgen Andersson12-Mar-09 12:11 
GeneralRe: loading user info after login from object Pin
Christian Graus12-Mar-09 12:20
protectorChristian Graus12-Mar-09 12:20 
GeneralRe: loading user info after login from object Pin
liamderice13-Mar-09 3:42
liamderice13-Mar-09 3:42 
Questionin excel how to use mailmerge Pin
sivapran12-Mar-09 9:24
sivapran12-Mar-09 9:24 
QuestionRefresh of a seperate gridview in an ASP.NET page. Pin
shawty_ds12-Mar-09 6:53
shawty_ds12-Mar-09 6:53 
AnswerRe: Refresh of a seperate gridview in an ASP.NET page. Pin
Christian Graus12-Mar-09 9:35
protectorChristian Graus12-Mar-09 9:35 
GeneralRe: Refresh of a seperate gridview in an ASP.NET page. Pin
shawty_ds12-Mar-09 12:57
shawty_ds12-Mar-09 12:57 
GeneralRe: Refresh of a seperate gridview in an ASP.NET page. Pin
shawty_ds12-Mar-09 13:06
shawty_ds12-Mar-09 13:06 
Questionbyte[] to string Pin
M.Ambigai12-Mar-09 6:43
M.Ambigai12-Mar-09 6:43 
AnswerRe: byte[] to string Pin
shawty_ds12-Mar-09 6:57
shawty_ds12-Mar-09 6:57 
GeneralRe: byte[] to string Pin
M.Ambigai12-Mar-09 7:53
M.Ambigai12-Mar-09 7:53 
GeneralRe: byte[] to string Pin
shawty_ds12-Mar-09 8:53
shawty_ds12-Mar-09 8:53 
GeneralRe: byte[] to string Pin
M.Ambigai12-Mar-09 15:54
M.Ambigai12-Mar-09 15:54 
GeneralRe: byte[] to string Pin
shawty_ds13-Mar-09 5:35
shawty_ds13-Mar-09 5:35 
AnswerRe: byte[] to string Pin
Yusuf12-Mar-09 8:53
Yusuf12-Mar-09 8:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.