.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

How to make ASP.NET MVC View Insecure via location tag in Web.Config

Posted By:      Posted Date: October 10, 2010    Points: 0   Category :ASP.Net
 

I have the following authorization settings in my web.config:

 <authorization>
      <deny users="?" />
 </authorization>

This deny's all anonymous access to the application accept the login page. In addition to this I am using authorization within each controller action via a custom authorize attribute.

I have one additional action that I would like to expose publicly in addition to the login page. This action does not have the authorize attribute on it. I have tried to make this view (resetPassword view) public by using the location tag in the web.config file like so:

 <location path="Account/ResetPassword" allowOverride="false">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>

In the path attribute above I have tried both the view as well as the action path, but it doesnt allow public access to the action.

I have even tried to put this view in a separate folder within the shared folder and put a separate web.config file to make that folder public like so:


View Complete Post


More Related Resource Links

Razor View Engine and Add Namespace in Web.Config Problem

  

Hello,

I am working on a MVC project with Razor view engine and I have the following:

  @MvcHtmlString.Create(
    Bundle.Css()
      .Add("~/Styles/FlyOnDreams.FlyOnPages.Base.css.less")
      .Add("~/Styles/FlyOnDreams.FlyOnPages.Core.css.less")
      .Render("~/Styles/FlyOnDreams.FlyOnPages.Core.min.css"))


This only works if I have on the same view the following:

  @using SquishIt.Framework;

However, on my Web.Config I have the following:

    <pages>

      <!-- Namespaces -->
      <namespaces>
        <add namespace="System"/>
        <add namespace="System.Web.Mvc"/>
        <add namespace="System.Web.Mvc.Ajax"/>
        <add namespace="System.Web.Mvc.Html"/>
        <add namespace="System.Web.Routing"/>
        <add namespace="Microsoft.Web.Mvc"/>
        <add namespace="SquishIt.Framework"/>
      </namespaces>

    </pages>


So if "SquishIt.Framework" namespace is added on Web.Config why do I need to have the @using on the view?

How to config a SendActivity make it consumes a WCF service?

  
In a ASP.net web project, I have a WCF service and Workflow service and my workflow service want to use the wcf service, so I use the SendActivity to consume the WCF service. I do this in the follow step: 1.Using Add the service reference dialog add the WCF service reference to my project 2.Add a SendActivity to the workflow and config it like this: EndpointConfigurationName:BasicHttpBinding_ISimpleService ServiceContractName:SimpleServices.ISimpleService OperationName:DoWork and set correct parameters.   All this config value I am copyed from the config file. But when I run this project it's always throw exception says "ContractFilter mismatch at the EndpointDispatcher" . But if I directly call the WCF service in code, it's all ok. For demo, I create a very simply WCF service and Workflow service for testing how to config, so I paste all the code here: namespace WFCallService.Services { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "ISimpleService" in both code and config file together. [ServiceContract] public interface ISimpleService { [OperationContract] void DoWork(string workName); } } namespace WFCallService.Services { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Sim

i make a web site using frame but session is expire Error message is my Config file is attache

  
i make a web site using frame  but session is expire message is Object reference not set to an instance of an object Description: HTTP 500. Error processing request. Stack Trace: System.NullReferenceException: Object reference not set to an instance of an object at System.Web.UI.Control.OnLoad (System.EventArgs e) [0x00000] in <filename unknown>:0 at System.Web.UI.Control.LoadRecursive () [0x00000] in <filename unknown>:0 at System.Web.UI.Page.ProcessLoad () [0x00000] in <filename unknown>:0 at System.Web.UI.Page.ProcessPostData () [0x00000] in <filename unknown>:0 at System.Web.UI.Page.InternalProcessRequest () [0x00000] in <filename unknown>:0 at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0 My Web Config file is<configuration>    <!-- store the database connection info here -->     <appSettings>        <add key="sBook_StoreDBConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\Program Files\CodeCharge\Examples\BookStore\BookStore_MSAccess.mdb;Persist Security Info=False" />            </appSettings>  <system.web>  <httpRuntime executionTimeout=&quo

web.config location in MVC

  
 Hi, Does the web.config sections <location> work in MVC 2? If so does anyone have an example as to how to configure it as I cannot make it work from all the examples for a Asp.net site.   Regards Bruce

how to make an editable grid view

  

hi all

i have created an application which shows records from the database

i have to make my grid view editable so that it will reflect into the data base 

can any one suggest me how

Regards

Roma


Calendar Day View - Location for all day events

  

How do you get the location to appear in the calendar for an all day event?  Right now, the only info that appears is the title, even though Location is the sub-heading chosen for the calendar columns in both week and day view (month view does not have a subheading choice).  I am unable to get any sub-headings to appear for all day events.

Thank you

 


Per Location View Settings sometimes ignored

  

Is this a bug or a feature?

1. Create a site with Tree View navigation enabled.

2. Create a document library.

3. Create two views: TopView and SubfolderView.  Make TopView the default view for the library.

4. Create a subfolder in the document library.

5. Using the "Configure Views for this location" setting on the subfolder, remove TopView from the list of available views.  SubfolderView should be the only available view for the subfolder.

6. My observations:

  • If you are in the root folder of the document library, and you use the Tree View to navigate into the subfolder, then the view default settings are correctly honored; you find yourself in the SubFolderView.
  • If you are in some other list, and you use the Tree View to navigate directly into the subfolder, then you incorrectly get TopView.
  • If you are in the root folder of the document library, looking at TopView, and you click on the folder title to navigate into the subfolder, then you incorrectly get TopView.

Configuration variations such as changing the view definitions to make the TopView available only for the top level or for certain content types do not work any better.

Do others experience the same problem?  Know of any workaround?  I would like to give our users a consistent experience

Make several changes across postbacks to an object in EF data module and view changes before persist

  

Is there a way to make several changes across postbacks to an object in an Entity Framework (.net 4) data module, view the data with changes (such as in a gridview), and then user clicks save to persist to the database?


Per location view Problem

  

Hello,

I try to use the "per location view" feature of SP2010.

I've got a problem with default view configuring. My hierarchy is :

Root Library -> View 1
   |> Folder 1 -> View 1
         |> Folder 2 -> View 2

When I go to Root Library or Folder 1, I've got the right view (View 1) but if I go to Folder 2, I still have the View 1 instead of default View 2.
It seems like folder link is based on parent folder url so it use http://spserver/Root Library/Forms/View1/

If anyone has an idea or solution,

Thank you.


how can i make the combo box in data grid view writable ?

  

Hello All ,

i want to make a combo box in data grid view column which allow me to read or write from it

the data grid view with column type of combo box only allow reading but i can't write 

how can i do that ? 


Kareem Naguib

trigger event to make tree view item bold

  

Hi guys, I need some help with a treeview item and stuff again. 

Right now I am using isSelected as the trigger, to make the items bold when clicked. But i have a few items, like say 5, all named one,two,three, etc.. but at the moment I'm only able to apply the bold effect when selected to 'one'.I'm not able to apply it to the other few.

 I am currently using XAML to do this, I'm thinking C# would be able to solve my problems, but how do i go about doing this?  Please helppp. Thank you so much. Attached below is the screenshot.

http://img856.imageshack.us/i/123dx.jpg/

 


Clean Web.Config Files (VS 2010 and .NET 4.0 Series)

  
.NET 4 includes a new version of the CLR, and a new .NET 4 specific machine.config file (which is installed side-by-side with the one used by .NET 2, .NET 3 and .NET 3.5).

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we've added over the years, including the functionality for:

.ASP.NET AJAX
.ASP.NET Dynamic Data
.ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC)
.ASP.NET Chart Control (which now ships built-into ASP.NET V4)
What this means is that when you create a new "Empty ASP.NET application" project in VS 2010, you'll find that the new default application-level web.config file is now clean and simple:

Truly Understanding View State

  
This article provides a detailed understanding of the ViewState.

GridView Parent Child View with JQuery Effects

  
I was just checked how to add some more cool effects to the GridView control using JQuery. In this post I will display parent-child data in the GridView control with some help of the wonderful JQuery library.

Let's first populate the GridView control.

Model View Controller (MVC) for ASP.NET

  
Model View Controller (MVC) architectures, immediately wonder how the MVC pattern can be applied in an ASP.NET world. This article will demonstrate how the MVC pattern can be applied to an ASP.NET web application and still maintain the basic Microsoft supplied architecture.

jQuery grid view plugin

  
jqGridView is new, client-rich, XML-based, ajax grid plugin for jQuery library. jqGridView provides professional solution for representing and editing tabular data on the web. Carefully designed, with powerful script API, this editable DHTML grid is easy configurable with XML, and shows convincing results working with large amounts of data. jqGridView allows easy implementation of nice looking(managed through css). jqGridView is not platform-depending plug-in, it can be used with different web -programming platforms like: ASP .NET/ASP, PHP, JAVA, CGI scripts etc. jqGridView has hight bowser compatibility.

jQuery grid view plugin

  
jqGridView is new, client-rich, XML-based, ajax grid plugin for jQuery library. jqGridView provides professional solution for representing and editing tabular data on the web. Carefully designed, with powerful script API, this editable DHTML grid is easy configurable with XML, and shows convincing results working with large amounts of data. jqGridView allows easy implementation of nice looking(managed through css
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend