If I'm developing an application that must accommodate
multiple security levels though secure login and my ASP.NET
web application is spanned across three web-servers (using
round-robin load balancing) what would be the best approach
to maintain login-in state for the users?

Answer Posted / a

/* Deafult.aspx.cs */

using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Text;

public partial class UI_Default3 : System.Web.UI.Page
{
public string projTable = string.Empty;
public string projCode = string.Empty;
public DataSet dst = null;
protected void Page_Load(object sender, EventArgs e)
{
dst = new DataSet();
dst = PopulateData.LoadProject();
StringBuilder sb = new StringBuilder();

if (Request.QueryString["projCode"] != null) {
projCode = Request.QueryString
["projCode"].ToString();
}

if(dst.Tables[0].Rows.Count > 0){
for (int i = 0; i < dst.Tables[0].Rows.Count;
i++) {
sb.Append("<tr>");
sb.Append("<td>");
sb.Append("<a href=\"../UI/Default3.aspx?
projCode=" + dst.Tables[0].Rows[i]["ProjCode"] + "\"><img
src=\"../Images/Tree.GIF\" /></a>");
sb.Append("</td>");
sb.Append("<td>");
sb.Append("<a href=\"../UI/Default3.aspx?
projCode=" + dst.Tables[0].Rows[i]["ProjCode"] + "\">" +
dst.Tables[0].Rows[i]["ProjDesc"] + "</a>");
sb.Append("</td>");
sb.Append("</tr>");

sb.Append("<tr>");
sb.Append("<td colspan=\"2\">");

if (!projCode.Equals(string.Empty) &&
projCode.Equals(dst.Tables[0].Rows[i]["ProjCode"].ToString
())) {
DataSet dstNew = new DataSet();
dstNew = PopulateData.LoadDivision
(projCode);

sb.Append("<table border=\"1\" >");
sb.Append("<tr>");
sb.Append("<td>Division ID</td>");
sb.Append("<td>Division Name</td>");
sb.Append("</tr>");

for (int j = 0; j < dstNew.Tables
[0].Rows.Count; j++) {
sb.Append("<tr>");
sb.Append("<td>" + dstNew.Tables
[0].Rows[j]["DivisionID"] + "</td>");
sb.Append("<td>" + dstNew.Tables
[0].Rows[j]["DivisionName"] + "</td>");
sb.Append("</tr>");
}
sb.Append("</table>");
projCode = string.Empty;
}

sb.Append("<tr>");
sb.Append("<td>");
}
projTable = sb.ToString();
}




}
}

-----------------------------------------------------------

/* Default.aspx */

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default3.aspx.cs" Inherits="UI_Default3" %>

<!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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<% =projTable %>
</table>
</div>
</form>
</body>
</html>

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you explain the basic use of dataview?

624


What is full trust in asp.net?

547


When cookie will expire?

582


What are client activated objects?

557


What is the latest version of asp.net?

537






What are server objects?

517


If iam developing an application that must accomodate multiple security levels though secure login and my asp.net web appplication is spanned across three web-servers (using round-robbin load balancing) what would be the best approach to maintain login-in state for the users?

549


Where is http session stored?

503


Explain the difference between mvc (model-view-controller) and mvp (model-view-presenter)? : asp.net mvc

515


How to implement role based security in asp.net mvc? : Asp.Net MVC

437


What is Difference between Production Serves and Development Servers? And Suppose, m adding/deleting C# file in a project based on the Specific Requirement. These Files are Automatically updated in Production Servers? So Which tool is needed to do This One?

1510


Where do we store our connection string in asp.net application?

526


Define xmlvalidatingreader class.

568


Can the validation occurs in server-side or client-side? If the validation occurs why should we do?

599


What is the advantage of mvc over asp.net? : Asp.Net MVC

509