Web Forms :: Disable A Page Depending On A User Session?
Jun 30, 2010
I have a page that I need to disable, or re-direct to another page if a different type of user logs in.
The application has this page for one type of user but another type of user is not allowed access it.
How would you do this type of thing?
View 3 Replies
Similar Messages:
Sep 29, 2010
I have been looking on the internet but don't seem to be able to find the answer. I am wondering is there a way to disable a validator on both the client and server side depending on the value of another control.
The situation is that I have a radiobutton that hides a textbox depending on the radionbuttonlist selected value . So I want to disable a validator on both server and clientside if the value selected is "N".
View 2 Replies
Apr 12, 2010
i am using a menu in masterpage.Based on user login i want to disable some menuitems depending on role.how to do this?
View 7 Replies
Jan 3, 2010
my asp.net application is workflow enabled.
by default all nodes of the tree should be disabled
once the workflow is completed.i need to enable the link of treeview??
my basic question is how to enable or disable the nodes the treeview depending on condition
suppose
if var a=0
then
LinksTreeView.SelectedNode.SelectAction = TreeNodeSelectAction.None;
View 1 Replies
Feb 10, 2011
I don't know how to do this, I think I need to find the control first.
[Code]....
View 26 Replies
Jul 2, 2010
I want to enable or disable text box in specific row depending on value of field in data source
View 5 Replies
Aug 4, 2010
I do not have much experience with asp:menus. How would I be able to make visible or invisible certian pages depending on a factor that I get from a session varaible? I plan on doing this on the backend in VB.net.
View 3 Replies
Jan 3, 2011
Is it possible to programmatically disable/enable say column field drill through capability of the matrix table report depending on the textbox.text of dropdownlist value but retaining drill through capability of row fields ?
View 1 Replies
Oct 7, 2010
I have a user control in my Master page and need to be able to Enable/Disable it from ANY page. How is this done? My user control has a few TextBox fields and a button. I was hoping to set a public property and simply Enable/Disable, but public properties seem to only work on the Master page code behind and not other pages.
View 4 Replies
Mar 31, 2010
Access to my application is controlled by user accounts. I would like my text labels to change within my pages depending on the user logged in. This needs to be easily managed.
What is the best way to achieve this? Would using the resources file work?
View 6 Replies
May 7, 2015
Lets suppose my application is deployed on a server located in USA. Now if any client visits my website from anywhere and from any device e.g Mobile , iPad , Surface or Laptop. Now if i want to save his local time then what should i use ?
DateTime.Now;
or
TimeZone curTimeZone = TimeZone.CurrentTimeZone;
var yourTime = TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.Local, TimeZoneInfo.FindSystemTimeZoneById(curTimeZone.StandardName));
tell me the difference between both commands.
View 1 Replies
May 7, 2015
URL.... Still there will be need of url in ajax method if i put javascript in site.master.cs . As what i have understood from that mysite.master.cs will be like this :
protected void Page_Load(object sender, EventArgs e) {
try {
if (Session["Prefix"].ToString().Trim() == "sys_admin") {
UserNameMasterLabel.Text = Session["UserName"].ToString().Trim() + " (ADMIN)";
[code]....
And site.master will be like this :
And I have to put next method in DailyLog.aspx page ? like this
System.Web.Services.WebMethod(EnableSession = true)]
public static int RefreshSession() {
HttpContext.Current.Session["Name"] = "BSD";
Configuration config = WebConfigurationManager.OpenWebConfiguration("~/Web.Config");
SessionStateSection section = (SessionStateSection)config.GetSection("system.web/sessionState");
int timeout = (int)section.Timeout.TotalMinutes * 1000 * 60;
return timeout;
}
But I have several pages in my website , by doing the above story will it work for Builder.aspx ? or any other page rather than dailylog.aspx ?
View 1 Replies
Apr 16, 2010
I have a Menu control in MasterPage based on web.sitemap file. My website has roles enabled (AspNetWindowsTokenRoleProvider) and uses Windows authentication mode. So, user has to be in a specific Windows Group to be able to access the site. I need to allow some users to see all menu nodes and some restricted set of nodes. How do I do that?
I would like to be able to create, say following Windows groups:
domain_namemy_app_users
domain_namemy_app_superusers
domain_namemy_app_admins
and code sitemap nodes this way:
<siteMapNode url="~/MOC_Masterdata_MOC_Approvers_Plain.aspx" title="MOC Approvers" description="MOC Approvers" />
View 5 Replies
Jan 12, 2011
I am using URL Routing to route user to his profile page, which is a child page. Now the problem is that all the images, javascripts references are distorted when i user the url to reach that page whether logged in or not logged in (both the cases). But after reaching this page when i login from this page thru my modal popup login control, all the references seem to work fine. It is to be noted that i am still in that same page which i reached after url routing. So upon logging from here the whole page works and displays fine.
How come the references are automatically adjusted when i am logging in from this page and are not referenced when i log in from other page and route here or when i am logged out?
Global.asax code:
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
public static void RegisterRoutes(RouteCollection routes)
{
routes.Add("UseridRoute", new Route
(
"profile/{user}",
new CustomRouteHandler("~/UserProfile.aspx")
));
}
View 2 Replies
Jul 23, 2012
I want to maintain user session in my project...the problem i am facing is when any user login is nt maintained.
View 1 Replies
Jun 15, 2010
I have an aspx page that has all its controls inside the scriptmanager and update panel.
I want to send the user to sessionexpired page after 20 mins of inactivity.
For this, I am writing the below code on page_load
Response.AppendHeader(
"Refresh", Convert.ToString((Session.Timeout * 60) + 10) &
"; URL=SessionExpired.aspx")
But the page is going to sessionexpired page after 20 mins even if the user is working on the page.
I think since I have all my controls in an update panel it is not doing a complete postback and hence the session object is not getting refreshed.
View 1 Replies
Sep 10, 2010
Building asp.C# shopping app that is using a hosted payment page to process payments (using posting of data to a hosted payment page). SSL certificate is signed and installed.
Flow:
Prelim) (HTTPS) Users authenticate using asp Login control
1) Users add items to cart.
2) (HTTPS)Users go to checkout page.
3) Users finalize their order, then click pay now after agreeing to T&C.
4) Server gets cart data (from MSSQL2005) and sets a transaction cookie (expiry set to 20 mins).
5) (HTTPS) Server Response.Redirects to an html page (in the same folder as the login protected pages).
6) Html page reads transaction cookie data and generates form fields.
7) (HTTPS) Html page posts data to hosted payment page (php).
8) User enters payment info and clicks pay now.
9) (HTTPS) hosted payment page posts info back to a .aspx page that checks if payment OK.
10a) If payment !OK, redirects to a declined page.
10b) (HTTPS) If payment OK, sets a verification cookie (expiry set to 20 mins). Then redirects to another html page.
11) Html page reads cookie data and generates form fields.
12) (HTTPS) Html page posts data to hosted verification page (php).
13) Verification page verifies (of course), if transaction ok.
14) (HTTPS) verification page posts data to a .aspx page that checks if verification OK.
15) If verification OK, process orders and do receipt stuff.
Issue:
This control flow was tested on an unsigned dev environment. SSL was being enforced, if needed on the unsigned SSL certificate. So we'd get prompts that certificate may be bad, but the control flow worked seamlessly.
However, now live with a signed SSL certificate, going from step 5 to 6, we are encountering a situation where some users (not duplicated every time, but verified that it does occur) when they click pay now and are redirected to the html page, they are forced back to the ~/login.aspx page (as if they were logged out).
Things to note:
a) The session did not time out.
b) The browsers have cookies and javascript enabled.
c) I can process the entire flow seamlessly on the same machine with other accounts, and occasionally, the same account.
So, basically, I'm stumped... Is this a viewstate error? A login control bug that won't let me redirect to an html page because it is now using a real SSL? Anyone have any experience with this kind of deal? I'm at a loss for solutions at this point.
View 1 Replies
Jan 17, 2010
I've come to the place where I need to add side bar menus to my page depending on userclass. I've set up the place-holders, but I was wondering what's the better way to add these.
View 3 Replies
Apr 26, 2013
I have made a web page in which there is login screen when user login it goes next page but my problem is if i directly enter the url of that page it open. I want it should not open unless the user log in...
View 1 Replies
Jan 14, 2010
I'm writing an application that will be accessed by different groups of users. I have one aspnetdb for logon; then depending on which group a user belongs to, I want to point them at a different 'content' database. Each user wants similar information, but unique to each group, so the schema of each database will be the same, but the content will be different. We're probably talking a dozen or so groups here.
What's the best way to achieve this? Would roles do? I could put each user into a specific role, group1, group2 etc, then check which role a user was in and use a connectionstring in the web.config file based on that. This seems like it would work, but it seems a bit of a cludge. A dozen or so connection strings doesn't seem too much of a problem, but it doesnt' really seem the correct use for roles.
View 7 Replies
May 19, 2010
I've an application only used in my site, and I'm interested to put in production from a global scope and the same instance to all the sites.
The fastest solution I've in mind is to use the current database for each different site, as copy from current system and add/clean a new one when a new site will start using it.
For this purpose I though in a front database where to check the logged in user site and then, depending user configuration, access his own site database.
I'm using now a connection string called ConnectionString1 in all the controls/code-behind database access. Then, my trouble is how to make it configurable to point to a certain database with the same connection string name but different connection string value depending on the user who has logged in, in order to not modify the current code I did. The only work I must do is change LogIn page to select appropiate database to access.
web.config:
[Code]....
View 8 Replies
Feb 15, 2010
I have two user groups set up in AD and Im "authorizing" against these in my web.config file :
[Code]....
What I need to do is redirect the user if they are a member of "CD" or "Individual".
View 2 Replies
Jan 27, 2011
My scenario is a 3-Tier app where the data tier is a SQL Server database, the middle tier is a WCF application hosted in a Windows Service and finally the presentation is an Asp.Net MVC application.As usual, the middle tier is the one that performs all of the business logic. Access database, define business rules.. etc. BUT now here's question: How do you handle security in such a scenario? I mean, the user has to log in on the ASP.NET application, but I want to authenticate it not only in ASP but in the WCF middle tier as well, since a WCF service is supposed to be accessed by more apps.
I want the user to log in on the Asp.Net application and let WCF know the credentials as well. Is there some kind of session in WCF in which to specify a logged in user? How do pros handle security in this case? I know you can secure the WCF services with message security, but how do Asp.Net and WCF sync on a single logged user? I want to secure WCF operations depending on the user for authorization means.
View 2 Replies
Sep 13, 2012
I have a dropdown on my page that reads a value from the users session.
ddlMemberGender.SelectedValue = Session("MemberGender")
there are two choices (obviously) : Man and Woman
So when the Session value sets the DropDown to Male it works fine. But if the user changes the DropDown to Woman in my code behind it still reads "Male" as the value... for example:
Response.Redirect("/post.aspx?Gender=" + ddlSearchMemberGender.SelectedValue) will still read the selected value that was set previously instead of the value it was changed to.
View 2 Replies
Jun 11, 2010
Iam building a website and i need to store somehow some informations that i will use in the whole site depending of the user type logged in.
Example:
1) User XPTO logs in
2) Query DataBase to see where he belongs
3) Store those 2 or 3 fields that i will get in Database in a persistent way to use it in the whole site.
Whats the best practices to do this?
View 4 Replies