Security :: Nesting Authenication Elements For Two Directories?

Mar 29, 2010

I am developing a web site where there are two groups of users: sponsors and members. I would like each group member to login based on the group they belong to, but through a different login page. It turns out that I cannot add two separate 'loginUrl' elements to my web.config file, so how would I workaround this?

I wanted to use: loginUrl="Members_Login.aspx" and loginUrl="Sponsor_Login.aspx"...

View 13 Replies

Similar Messages:

C# - Nesting Configuration Elements In Web.config?

Feb 26, 2010

how to use System.Configuration in .NET and would like to know if there is a way to infinitely nest configuration settings in my web.config file.

Let's say I have two types of objects - a Page, and a PageGroup. A Page represents a real page on my site, and a PageGroup represents a collection of Pages and (possibly) other PageGroups.

My web.config file might contain something like:

<pagegroup name="outer_group">
<page name="page1" url="page1.htm" />
<page name="page2" url="page2.htm" />
<pagegroup name="middle_group">
<page name="page3" url="page3.htm" />
<pagegroup name="inner_group">
...and so on...

My limited understanding of Configuration classes leads me to believe that this is not what they were designed for - but I'm hoping that I'm wrong.

Is it possible to use ConfigurationElementCollections and ConfigurationElements (or any other applicable ConfigurationClasses) in this manner?

View 1 Replies

Security :: Forms Authenication Prevent Word Docs Being Rendered

Nov 23, 2010

I have a .Net 4 web application which has a folder called "docs" which is full of Word docs on the root of the website. The words docs are linked with a gridview in my "admin" section

I only want Autheicated users to be able to renders the word docs in the doc folder. I am finding if the user logs out and they manually type in the url to the Word document it renders the file eg.

i have tried putting this in my web.config but did not work for the Word docs. It stops the rendering of .aspx files but not .doc's

<location path="docs">
<deny users="?" />

Is this because the .doc extension is not hadled by the .Net framework and that I need to do something to Handler Mapping in IIS7? I would prefer to put all my security setting in the web.config ideally

View 5 Replies

Enumerate The Directories And Sub Directories In A Windows Form Using A Tree View?

Feb 18, 2010

I'm trying to enumerate the directories and sub directories in a Windows Form using a Tree View. I can view the directories but when I want to see the files in the sub directories I only see the files from the root.


View 1 Replies

Security :: Forms Authentication For Different Directories?

Feb 2, 2011

I have a website that contains control panel section in saperate folder, Admin. There are 2 login pages, one for root directory (appl for end users) and one for admin directory. I define authentication and authorization in root web.config. It works for root dir. But when i add web.config for Admin dir it gives me build error "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level". Note: I have not added application as virtual dir in IIS. I run it from File System ie by using port no with localhost -http://localhost:xxxx/mysite/

View 3 Replies

Security :: Breaks Password Protection Directories?

Apr 21, 2010

We upgraded the ASP version in IIS to ASP 4 and now experiencing an odd issue with password protected directories. The directory uses a Web.config file that only allows a single login to access the directory. This worked fine until we did the upgrade to ASP 4. Now when the user logins in, it recursively prompts them to login. If the user hits cancel, they are able to access the page like normal. Is this a ASP 4 or IIS bug?

View 3 Replies

Security :: Asp Control As Per User Login Or Just Web Page And Directories?

Jul 23, 2010

I was reading some tutorials on Internet and Go through some Scott articles. I learn how to make form security with different types and roles. Now I wanted to know is it possible to secure control as per user login or just web page and directories.

View 17 Replies

Configuration :: Ldap Authenication Code Is Not Working With IIS But Works With Visual Studio Developement Webserver?

Sep 13, 2010

I have weird issue here, I have a method that takes a login Id and authenticates with LDAP active directory and returns the employee Id. It works great when I run the application in Visual studio 2008 ( it uses the default visual studio developement webserver). The code authenitcates the login id and returns emp Id perfectly. But the problem comes when I publish the code to the Local IIS in my developement PC.


View 4 Replies

Security :: Accessing Elements Within Login View?

Mar 11, 2010

I have the following code for my page:


And the following .cs file associated with it:


I would like to be able to do the following in the .cs file for this page:

#1. Initially "Submit News" is disabled. The admin must click "Preview News" which will update the newslabel temporarily and also enable the "Submit News" button.

#2. When the "Submit News" button is clicked, the news.txt file should be opened and whatever content is currently in the newslabel.Text will be written to news.txt. The news will then be updated for anyone to see.

Right now, if I try to do "submitnews.Enabled = false;" is does not let me because it thinks that submitnews is not in the current context. Basically I need to know how to access elements that are within a <asp:LoginView> area.

View 2 Replies

Load Dynamic List Of Elements AFTER FINISHED Loading Of Several Form Elements?

Mar 1, 2010

I have...a dynamic populated select box several input boxes a submit button form fields are loaded initially using cookies several dynamic populated divs

I want... start loading the content of my DIVs after all FORM elements have been loaded completely (= filled with data, select boxes are populated)

Sample code:


View 1 Replies

Web Forms :: Nesting Code In A Connection String?

Apr 13, 2010

s is possible to nest connection string code as in the following?

<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%&#36; ConnectionStrings:'<%&#36; appSettings:myconnstr%>' %>">

View 2 Replies

C# - Nesting Strongly Typed Control Into Master Page .NET

Nov 13, 2010

I have a site using a single In the I have a strongly typed user control (.ascx) called "ControlPanel". Its type is ControlPanelViewModel.

<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<% Html.RenderPartial("ControlPanel"); %> <!-- Here I need to pass the ControlPanelViewModel -->
<!-- main content area -->

View 2 Replies

C# - Nesting A SharePoint Webpart Inside Of User Control?

May 4, 2010

I know it's usually the other way around, but I have some extenuating requirements that must be met (read as "No one bothered to do the research and now I have to bail them out")

I have a standard user control (ascx) that is to be imported into a SharePoint 2007 website. Due to a design constraint, a sharepoint web part that is also needed has to be nested inside of this user control.

So in other words, the user control would have to look something like this:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="foo.ascx.cs" Inherits="foo" %>
<div id="container">
<!-- SharePoint web part goes here -->

View 1 Replies

Forms Data Controls :: Nesting One List View Inside Another?

Mar 22, 2011

I need to create a repeat region area where I display the Area as a heading and then listing the cities within that area.

I can achieve this using a gridview and nesting one inside another using this tutorial: [URL]

But I really need the ability to customize the page that only a Listview offers. So does anybody know of a good tutorial to do this?

Note I'm Using MS Access for the datasource of both City and Area tables.

View 5 Replies

Forms Data Controls :: Nesting A Gridview Inside A Repeater?

Jul 7, 2010

I am trying to nest a gridview inside a repeater. The gridview will then display data based on what repeater it is sitting. I can get it to work fine with a repeater nested in a repeater, but not with a gridview.


How do I do a findcontrol to find a gridview in a repeater?

View 2 Replies

How To Hide Specific Elements On A Razor View Based On Security Without Logic In View

Apr 4, 2011

I have looked all over for elegant solutions to this not so age-old question. How can I lock down form elements within an ASP.Net MVC View, without adding if...then logic all over the place? Ideally the BaseController, either from OnAuthorization, or OnResultExecultion, would check the rendering form elements and hide/not render them based on role and scope. Another approach I have considered is writing some sort of custom attributes, so as to stay consistent with how how we lock down ActionResults with [Authorize]. Is this even possible without passing a list of hidden objects to the view and putting if's all over? Other background info: We will have a database that will tell us at execution time (based on user role/scope) what elements will be hidden. We are using MVC3 with Razor Viewengine. We're utilizing a BaseController where any of the Controller methods can be overridden.

View 1 Replies

Web Forms :: Getting Some Weird Results When Nesting Login Control Inside Absolutely Positioned Element?

Jan 7, 2010

Login control is nested inside the div element.

aspx file:


a) As far as I know, the width of a nested element (Login) should by default be constrained by the width of a parent element. But that isn't the case, since Login is always expanded to its full width, no matter how small is the width of a #parentE element. why Login
doesn't have its width constrained?

b) I'm also getting some inconsistent results: if I change the value of "right" property to 200px, then element should be closer to the right edge by one third, but is in fact closer to the edge by 50%. If I then change the value of "right" property to 100px, then the element is only few pixels removed from the right edge of the browser ( while it should be 100px removed from the right edge )

View 1 Replies

DataSource Controls :: Maximum Stored Procedure, Function, Trigger, Or View Nesting Level Exceeded (limit 32) ?

Feb 24, 2010

I have a table with recursive relation,a function and a sp for readig data from that table:


When I execute sp,I got this error:Maximum stored procedure,function,trigger or view nesting level exceeded (limit 32).

View 9 Replies

JQuery :: Access Html Elements Like "<p>" Tag And Others When Html Elements Are In Content Page Only?

Oct 3, 2010

i have found out a way to find controls on content pages by using

var txt = $('input[id$=TextBox1]'). But how to access html elements like "<p>" tag and others in jquery when the html elements are in content page only.

View 5 Replies

How To Get Files In In All Directories

Oct 25, 2010

This is in class file
Imports Microsoft.VisualBasic
Imports System.IO
Imports System.Collections.Generic
Public Class FileSrch
'' File Search Options
Public Enum FileSearchOptions
End Enum
Public Shared Function GetSearchcriteria(ByVal DatetoSearchwith As Date, ByVal Filename As String, ByVal FileExtension As String, ByVal SearchOptions As FileSearchOptions)
Select Case SearchOptions
Case FileSearchOptions.YearFirst
Return String.Format("{0}_{1:yyyyMMdd}{2}", Filename, DatetoSearchwith, FileExtension)
Exit Select
Case FileSearchOptions.MonthFirst
Return String.Format("{0}_{1:yyyyMMdd}{2}", Filename, DatetoSearchwith, FileExtension)
Exit Select
Case FileSearchOptions.NormalFiles
Return String.Format(Filename + FileExtension)
Case FileSearchOptions.DateinExtension
Dim ExtensionFormat As String = (Convert.ToInt32(DatetoSearchwith.ToString("mm")).ToString() & DatetoSearchwith.ToString("dd"))
'' Month in Double Digit
If DatetoSearchwith.Month > 9 Then
ExtensionFormat = (DatetoSearchwith.ToString("mmm")(0) & DatetoSearchwith.ToString("dd"))
End If
Return String.Format("{0}.{1}", Filename, ExtensionFormat)
Case Else
Return String.Format("{0}.{1}", Filename, FileExtension)
End Select
End Function
Public Shared Function GetFiles(ByVal RootDirectory As DirectoryInfo, ByVal Filename As String, ByVal FileExtension As String, ByVal DatetoSearchwith As Date) As List(Of FileInfo)
Dim FiFiles As New List(Of FileInfo)
For Each DateOption As FileSrch.FileSearchOptions In [Enum].GetValues(GetType(FileSrch.FileSearchOptions))
FiFiles.AddRange(RootDirectory.GetFiles(FileSrch.GetSearchcriteria(DatetoSearchwith, Filename, FileExtension, DateOption), SearchOption.AllDirectories))
Return FiFiles
End Function
End Class
This in Button Click
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim FileName As String
' Dim fileName As String = txtextension.Text.Trim().Substring(0, txtextension.Text.Trim().IndexOf("."))
If txtextension.Text.Contains("_") Then
FileName = txtextension.Text.Trim().Substring(0, txtextension.Text.Trim().IndexOf("_"))
FileName = txtextension.Text.Trim().Substring(0, txtextension.Text.Trim().IndexOf("."))
End If
Dim extensionToSearch As String = Path.GetExtension(txtextension.Text)
'Dim Directory As String = Path.GetDirectoryName(txtpath.Text.Trim())
Dim Directory As New DirectoryInfo(txtpath.Text.Trim())
'Dim filess As String() = Directory.GetFiles(txtpath.Text, txtextension.Text, SearchOption.AllDirectories)
'For Each fiFile As String In filess
' Response.Write(fiFile & "</br>")
Dim SearchedFiles As List(Of FileInfo) = FileSrch.GetFiles(Directory, fileName, extensionToSearch, Now.Date())
'Dim searchedFiles As List(Of FileInfo) = GlobalStuff.GetFiles(directoryToSearch, "whateverfilename", extensionToSearch, DateTime.Now)
If (SearchedFiles IsNot Nothing AndAlso SearchedFiles.Count > 0) Then
For Each fi As FileInfo In SearchedFiles
Response.Write(fi.Name & "</br>")
Response.Write("No files found")
End If
End Sub

Now,we need to address the following things in that to complete req, 1) If I enter filename_mmddyyyy.txt it should fetch only files having current date in their name in mmddyyyy format.For eg. If I give test_mmddyyyy.txt in txtextension it should return only files with test_10222010.txt and not thee ones with yyyymmdd and all...Right now I am getting all the files created in the current date including the one with ordinary test.txt and also test_20101022.txt .......And the third thing filename.mdd everything is getting passed correctly but it is not fetching the file ..Again test,test_20101022.txt everything comes.It shouldn't be like that it should only fetch files with .mdd (current date)....

In my above code i have two text boxes one for file path and other one for getting extension and also for gettting file names with diff search criteria.....What i do is i should implement file search which is like as mentioned below -

1) it should search for all files if i enter *.*,only jpg if *.jpg, and files like nks.txt if i enter ?

2) if i enter the filename alone without extn it should return me filenames that exist without extension in directories. 3) the final thing is the date in filename where my file will be like filename_mmddyyyy.txt or filename_yyyymmdd.txt or filename.mdd.In first case it should return only files with current date in mmddyyyy format and txt taht....last case is mdd in extn...

where if i enter filename.123,it sould get me files with jan 23(23 currnt date) and for months greater than 9 it is N for nov ,D for dec and so on.But in m,ytext box i will enter only file.mdd only .and also filename_mmddyyyy.jpg like that....

View 2 Replies

App_localresources Not Working With Directories?

Apr 13, 2010

i have a test project with the following directory structure:




using the following simple code:


View 4 Replies

C# - Create Virtual Directories In IIS 7.5?

Jul 25, 2010

My web application knows how to create sub-applications ( applications with web.config file, located in sub folders of the root application).

Now, I need to configure each sub-application in the IIS with a Virtual Directory, AND, make this new virtual directory an application in a specified application pool.

Is there any API for IIS7.5 using .NET ?

View 1 Replies

Setting Up App On A Vps / Need To Set Any Of The Folders As Virtual Directories

Sep 16, 2010

I just got a windows vps setup at a hosting company and about to install a big web application that is a store front. Do I need to set any of the folders as virtual directories? I'm so confused on all of this. Do I just copy the folders and files over and thats it? It has Plesk to use for the control panel. I know I have to set the directories to run as application but is there anything else?

View 1 Replies

Can Upload Entire Directories Using Uploadify

Mar 3, 2011

I am using uploadify along with ASP.NET to upload files to my server. At the moment I have to recreate the folder structure and upload the images in batches per directory.Does anyone know of a way of using Uplodify or any other tool that would allow me to select a folder and upload the entire directory?

View 2 Replies

How To Set Virtual Directories Dot Net Framework Version 2.0 To 4.0

Oct 20, 2010

I have installed VS2010. already i have VS 2005 and website working with framework 2.0.After installation, now I am unable to set version for IIS virtual directories to Dot net Framework verion 4.0.How can i set virtual directories Dot net Framework version 2.0 to 4.0?

View 2 Replies

Copyrights 2005-15, All rights reserved