Customize Access Requried page with code behind attached to it in sharepoint 2010

Hi,
I have modified default AccessDenied page to my custom accessdenied.aspx page and put Request Access button on it and javascript client side redirection to my requestaccess (reqestaccess.aspx, reqestaccess.aspx.cs) application page.
Here the problem is whenever i try to redirect to custom requesaccess page in _layouts it again shows me accessdenied page since user is not having access.
I changed requrestaccess to my custom requestaccess through Powershell command (UpdateMapping - 5). I can only modify the UI part of requestaccess.aspx and can not bind code behind where i want user to select combination of what access is required
on the site, there are lots of controls on requestaccess page e.g. dropdown that fetches data from list\external list and so on.
I tried many things to attach code behind to requestaccess page e.g. <%@ Page Inherits="codebehind.cs" /> and all.
Q - How can i redirect user to custom request access page (includes both aspx, aspx.cs) and allow user to interact with custom page? Is there any way OR WORKAROUND to do this in Sharepoint 2010?
OR
Can we overide with ElevetedPermissions in UI\CodeBehind and show the application page to user?
OR
Can user access application page even though they donot have rights to access site? Anything will do.
OR
In short, I need to redirect a user to some .aspx\.aspx.cs page from AccessDenied page, irrespective of user having access or not. 
I hope question is clear enough to understand the issue. :)
Regards,
Rahul

Hi,
According to your post, my understanding is that you had an issue about the custom Access Required page.
Microsoft supported using code behind, but for these pages it seemed some difference.
However, as a workaround, we can put all the functionality to the aspx page directly.
http://umbraes-tower.blogspot.com/2011/10/custom-request-access-page-in.html
More reference:
http://onlinecoder.blogspot.com/2011/05/how-to-customize-requestaccess.html
http://oszakiewski.net/eric/customizing-the-access-request-page-in-sharepoint-2010
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support

Similar Messages

  • Custom Master Page with Code behind in SharePoint 2013

    Hi All,
    I want to create the Custom Master Page in Sharepoint 2013 with Code file in it.
    Is it possible to create? if YES the how i can achieve it??
    PD

    To add something to Amit's reply, you can refer to the following link on how to create master page with code behind if you are new to ASP.net.
    Walkthrough: Creating and Using ASP.NET Master Pages in Visual Web Developer
    http://msdn.microsoft.com/en-us/library/ehszf8ax(v=vs.90).aspx
    Miles LI TechNet Community Support

  • Extending component with code behind

    Hi,
    I have read an article about extending components with code
    behind:
    http://www.adobe.com/devnet/flex/quickstart/building_components_using_code_behind/
    I have a question about that. Maybe someone can help me.
    Example:
    {components/CartClass.as}
    package components
    public class CartClass extends DataGrid
    public function CartClass()
    super();
    {components/Cart.mxml}
    <?xml version="1.0" encoding="utf-8"?>
    <shop:CartClass xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns:shop="components.*"
    >
    </shop:CartClass>
    Everthing works fine but when i add:
    <mx:columns>
    <mx:DataGridColumn headerText="Title" />
    </mx:columns>
    between the shop:CartClass tag, Flex says:
    Could not resolve <mx:columns> to a component
    implementation
    Anyone knows why?

    "sjerry-" <[email protected]> wrote in
    message
    news:gcq38m$1rg$[email protected]..
    > Hi,
    >
    > I have read an article about extending components with
    code behind:
    >
    http://www.adobe.com/devnet/flex/quickstart/building_components_using_code_behin
    > d/
    >
    > I have a question about that. Maybe someone can help me.
    >
    > Example:
    > {components/CartClass.as}
    > package components
    > {
    > public class CartClass extends DataGrid
    > {
    > public function CartClass()
    > {
    > super();
    >
    > }
    > }
    > }
    >
    >
    > {components/Cart.mxml}
    > <?xml version="1.0" encoding="utf-8"?>
    > <shop:CartClass xmlns:mx="
    http://www.adobe.com/2006/mxml"
    > xmlns:shop="components.*"
    > >
    >
    > </shop:CartClass>
    >
    > Everthing works fine but when i add:
    > <mx:columns>
    > <mx:DataGridColumn headerText="Title" />
    > </mx:columns>
    >
    > between the shop:CartClass tag, Flex says:
    > Could not resolve <mx:columns> to a component
    implementation
    columns is actually a property of the DataGrid instance,
    rather than the
    DataGrid class itself, so it needs to be in the same
    namespace as the actual
    DataGrid subclass:
    <shop:columns>
    <mx:DataGridColumn headerText="Title" />
    </shop:columns>

  • I have a printer xerox 3220 on networking ,have pc´s and a mac ,problem:it´s already install but does not work ,only print many page with code program,i will appreciate the solution

    i have a printer xerox 3220 on networking ,have pc´s and a mac ,problem:it´s already install but does not work ,only print many page with code program,i will appreciate the solution

    Hi guillermospain,
    Welcome to the Support Communities!
    The article below may be able to help you with this.
    Click on the link to see more details and screenshots. 
    OS X: Connecting a Wi-Fi printer to your Wi-Fi network
    http://support.apple.com/kb/ht3500
    OS X Mountain Lion: Set up a printer
    http://support.apple.com/kb/PH11145
    OS X Mountain Lion: Reset the printing system
    http://support.apple.com/kb/PH11143
    Cheers,
    - Judy

  • Custom List Form - newform.aspx with code behind - beginner

    Hi,
    I am working on a request whereby I have to customize the NewForm.aspx. The form will have roughly about 30 controls. One of the controls on the form will pull data from a web service. Another will pull data from a sharepoint list, this is quite complex
    as there will be some logic involved. The form data will then be input as the items into the Main SharePoint list.
    I do know that there will be some code behind on the custom NewForm.aspx, and that it has to be done on Visual Studio.
    I am confused between the application page, custom form web part, or is there any others missing out. Which one of this the best practice, also can someone point out some msdn articles. I found some on the Net, but I find the guides too complicated and am
    finding it difficult to understand. 
    Please help

    It depends on how your users will interact with the list, are they going to use list newform.aspx to submit the data or will you be providing separate interface to submit the data. You can always go with custom webpart to incorporate all your business logic
    along with the interface required for end users.
    building custom webparts in SharePoint 2010
    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/02/15/intro-to-sharepoint-2010-development-how-to-build-and-deploy-a-web-part.aspx
    Custom List form
    http://blog.karstein-consulting.com/2010/12/29/walkthrough-create-custom-sharepoint-2010-list-form-for-deployment-in-a-visual-studio-2010-project/
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • Problem with Restrict Access to Page with access level using ASP

    I'm using Dreamweaver CS3 with ASP-VBScript and an Access
    database. The pages were created from scratch for this project,
    using those tools all the way through.
    I've created a login page, an admin homepage, and add, edit,
    and list records pages for three tables. The login page uses the
    Server Behavior "Log in User", all other pages use the Server
    Behavior "Restrict Access to Page". All of these are based on an
    Access Level.
    Login seems to work correctly, and redirects to the admin
    homepage. From the admin homepage, I can open any other page as
    expected, and they initially display correctly. On the add and edit
    pages, however,
    submitting the form often results in getting logged out, but
    not always.
    Once this happens, I can log back in, but other problems will
    sometimes occur during that second login session. Sometimes,
    logouts will occur on pages that worked fine during the first login
    session. Sometimes, another session variable that I've setup
    manually will change when it shouldn't...as if there were two
    values stored for my session variable, and reloading the page
    changes to the other value.
    This
    post seems closest to my experience, but it doesn't look like
    there was really an answer beyond "I had to fight with it for a bit
    to get it to work":
    I suspected that there is some problem with session settings
    on the server. We have an almost identical tool on the same server
    that was developed with an older version of DW that works more
    reliably; it sometimes has problems with the initial login, but
    never has a problem after that.
    Has anyone experienced problems like this? Any suggestions
    for what to check? I'm really pulling my hair out since it's so
    unreliable...the kind of problem that goes away when you try to
    show someone and comes back when they leave.

    Hello,
    I was thinking that all I would need would be the username, although username and paswsword would be more secure.  There are about 50 users and no groups or levels.  They are all equal ... same level.
    The website is private and there is a general content area for all users and then there will be private areas for each user where proprietary documents will be held.  I need to be able to ensure that user 'A' can only see the user 'A' pages, user 'B' can only see user 'B', etc.
    I don't really understand what the Dreamweaver script is doing, but the overview sounded like it was the right tool to accomplish what I'm trying to do.
    Any assistance greatly appreciated.
    thanks.

  • Firefox 20.0.1 with Shockwave 11.7.700.169 crashes when you access web pages with video content

    I have a problem with Firefox 20.0.1 under Windows 7 with Shockwave flash 11.7.700.169. When I access a web site / web page with some content that requires Shockwave (usually videos) I can view the video, however, when I exit Firefox, it will crash with "Firefox encountered a problem - check for a solution ...". I also have a web site "MyHeritage" that when I access a family tree I repeatedly get a message "Video driver stopped working - NVIDIA driver ... has successfully recovered". If I disable Shockwave, Firefox will not crash in both cases, unfortunately, I cannot watch any video content.
    I did go to the Adobe web site and updated what I thought was my version of Shockwave, unfortunately this installed Director for netscape V12.2, I have disabled this plug-in.
    BTW - running Firefox in safe mode (add-ons disabled) stopped my NVIDIA driver from crashing and also stopped Firefox from crashing when exiting.

    Please check if all your plugins are up-to-date using [http://mozilla.com/plugincheck Mozilla Plugin Check site].
    Once you're there, the site will check if all your plugins have the latest versions.
    If you see plugins in the list that have a yellow ''Update'' button or a red ''Update now'' button, please update these immediately.
    To do so, please click each red or yellow button. Then you should see a site that allows you to download the latest version. Double-click the downloaded file to start the installation and follow the steps mentioned in the installation procedure.

  • Java pages w/ code behind

    I want to create a web page that contains Java code. How can I do this?
    E.G. For anyone who's done .NET I'm looking for the Java equivalent of creating an asp page w/ C# code behind.

    JSP = Java server page

  • Change Master page of a site using ECMA Script in sharepoint 2010

    Hi All,
    I'm working on SharePoint 2010.
    I have a requirement where in I need to create a site and apply a particular master page to the newly created site using
    ECMA Script.
    The site gets created but while applying the master page it gives me an error stating the method 'set_masterUrl' is not defined.
    Here is my code:
    $(document).ready(function () {
    ExecuteOrDelayUntilScriptLoaded(createSite, "sp.js"); //This is used to ensure until sp.js is loaded, createSite will not be executed.
    function createSite() {
    var context = SP.ClientContext.get_current();
    var collWeb = context.get_web().get_webs();
    var webCreationInfo = new SP.WebCreationInformation();
    webCreationInfo.set_title('TestSite');
    webCreationInfo.set_description('Description of new Web site...');
    webCreationInfo.set_language(1033);
    webCreationInfo.set_webTemplate('STS#0');
    webCreationInfo.set_url('TestSite');
    webCreationInfo.set_useSamePermissionsAsParentSite(false);
    var oNewWebsite = collWeb.add(webCreationInfo);
    context.load(oNewWebsite);
    context.executeQueryAsync(Onsuccess, onfail);
    function Onsuccess() {
    dummy(context, oNewWebsite);
    function onfail(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    function dummy(context,oNewWebsite)
    var strMasterPageUrl = '/_catalogs/masterpage/Test.master';
    oNewWebsite.set_masterUrl(strMasterPageUrl);
    oNewWebsite.set_customMasterUrl(strMasterPageUrl);
    oNewWebsite.update();
    context.executeQueryAsync(Onsuccess1, onfail1);
    function Onsuccess1() {
    alert("Done");
    function onfail1(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    Please help.
    Thanks,
    Sachin

    The issue is coming because the scope of context and oNewWebsite is not available in your success method. Try to modify the code as below and see if that helps.
    $(document).ready(function () {
    ExecuteOrDelayUntilScriptLoaded(createSite, "sp.js"); //This is used to ensure until sp.js is loaded, createSite will not be executed.
    var context = null;
    var oNewWebsite = null;
    function createSite() {
    context = SP.ClientContext.get_current();
    var collWeb = context.get_web().get_webs();
    var webCreationInfo = new SP.WebCreationInformation();
    webCreationInfo.set_title('TestSite');
    webCreationInfo.set_description('Description of new Web site...');
    webCreationInfo.set_language(1033);
    webCreationInfo.set_webTemplate('STS#0');
    webCreationInfo.set_url('TestSite');
    webCreationInfo.set_useSamePermissionsAsParentSite(false);
    oNewWebsite = collWeb.add(webCreationInfo);
    context.load(oNewWebsite);
    context.executeQueryAsync(Onsuccess, onfail);
    function Onsuccess() {
    dummy(context, oNewWebsite);
    function onfail(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    function dummy(context,oNewWebsite)
    var strMasterPageUrl = '/_catalogs/masterpage/Test.master';
    oNewWebsite.set_masterUrl(strMasterPageUrl);
    oNewWebsite.set_customMasterUrl(strMasterPageUrl);
    oNewWebsite.update();
    context.executeQueryAsync(Onsuccess1, onfail1);
    function Onsuccess1() {
    alert("Done");
    function onfail1(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    The other way is to use this.context and this.oNewWebsite. To see how you can modify your code have a look at the following link.
    http://msdn.microsoft.com/en-us/library/office/jj163201%28v=office.15%29.aspx
    Geetanjali Arora | My blogs |

  • Access web page with alternate tab displayed by default

    I have a WebHelp project with a start page that displays the
    Contents tab by default. Is there a way through the URL to have a
    different tab (e.g., the Search tab) display by default? Thanks.
    Tim

    I need a way to open the same WebHelp project with the
    Contents tab displayed by default if the project is accessed
    through one method or with the Search tab displayed by default if
    the project is accessed through another method. I am using RoboHelp
    X5.0.2.
    Peter, I generated my project with the Search tab set as
    default. I viewed the start page, and the Search tab was correctly
    displayed by default. I made a copy of this start page and saved it
    to a different folder location. I regenerated my project with the
    Contents tab set as the default. I copied the alternate start page
    into the project so that I essentially had a start_contents.htm
    page and a start_search.htm page. This method was ineffective. Both
    the start_contents.htm page and the start_search.htm page now open
    with the Contents tab displayed by default.
    Is there a way through the URL to be able to specify the tab
    to display by default (sometimes the Contents tab and sometimes the
    Search tab) for the same help project, either through using
    multiple start pages (which in my test appears to be ineffective)
    or through additional code in the URL itself?

  • Accessing tab page with shortcut keys

    How to access different tabs in a tab canvas using shortcut keys?
    dipincha

    e.g. you use your oracle terminal and define:
    KEY-F0 = Ctrl-0
    KEY-F1 = Ctrl-1
    KEY-F2 = Ctrl-2
    After that you can use the forms-trigger KEY-F0 to -F9.
    In the trigger you hardcode e.g.
    KEY-F1 : go_item (<Item of first tab>)
    KEY-F2 : go_item (<Item of second tab>)
    That's it
    Gerd

  • Hanging while accessing a page with Windows Integrated security?

    Here is the code I am trying:
    HttpMethodBase method = null;
    try {   
    HttpClient client = new HttpClient();
    client.getState().setCredentials(AuthScope.ANY,
    new NTCredentials(userName, pwd, host, domain) );
    System.out.println(httpServiceURL);
    method = new GetMethod(httpServiceURL);
    method.setDoAuthentication( true );
    int status = client.executeMethod(method);
    System.out.println(status + "\n" + method.getResponseBodyAsString());
    This code works fine on stand alone java application, but when I deploy it to Weblogic.. it just hangs at GetMethod. No exception, nothing..
    when I change that to
                   method = new GetMethod();
                   method.setFollowRedirects(true);
                   method.setPath(httpServiceURL);
    It is failing at executeMethod().
    any suggestions? Thanks,

    This Weblogic... is it running as a Windows service? Under what user profile? Presumably the authentication would be based on that user profile.

  • Infopath 2010 Web Form will not run code behind or load External Lists after FormEvents_Loading added

    Building a form to edit and create data in external list. The business rules do not allow for creation in an external list bound InfoPath form. (We are cascade filtering multiple drop down lists from external content type).
    All works to write code behind to push new record or update record in external list. The big issue came when trying to add FormEvents_loading event to the code to capture URL parameter. I want to be able to pass the Primary Key of the record to
    edit, load the data into the form and allow editing and submit. I have tested by manually entering the data and the form works. The form will no longer load data from external lists for the drop downs and shows an error stating "The custom code
    in the form cannot be run. This functionality may be deactivated
    on the server. For more information, contact the server farm administrator."
    I think this is related to moving from the normal forms services into sandboxed code service. Is there a way to access external content types and still have form loading event capture URL parameters?
    The code to capture the URL is listed below:
    XPathNavigator myNav1 = this.MainDataSource.CreateNavigator();
    string InputF1 = string.Empty;
    if (e.InputParameters.ContainsKey("AuthPK"))
    InputF1 = e.InputParameters["AuthPK"];
    myNav1.SelectSingleNode("/my:myFields/my:CodeData/my:DatabaseUpdateStatus", this.NamespaceManager).SetValue(InputF1);
    myNav1.SelectSingleNode("/my:myFields/my:CodeData/my:pk_tblOFCAuthorizations", this.NamespaceManager).SetValue(InputF1);
    else
    myNav1.SelectSingleNode("/my:myFields/my:CodeData/my:pk_tblOFCAuthorizations", this.NamespaceManager).SetValue("0");
    Is there another way to pass parameters to the form? I tried using web part connection, but that does not work with code behind form at all, which would stop me from updating external list.

    Hi,
    As this question is more related to InfoPath development, I suggest you post it to Visual Studio Tools for Office (VSTO) Forum, more experts will assist you with this issue.
    Visual Studio Tools for Office (VSTO) Forum:
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=vsto
    Best Regards,
    Lisa Chen
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]

  • Can't load my own pages with .htaccess protection

    It's very strange.
    First time I noticed that problem was on a project page who I created. The page is not for the public access, so I decide to protect it simply with an htaccess file and it works without any problems for a long time in Safari until that point who I make a little mistake by typing the username or password and let Safari safe this wrong information. Since them I was not longer able to reach the page with Safari, but still with other browsers.
    So I can life with that, because it's not an importend page who I visit each day.
    But now I have a nother page who deliver the same problem. The logininfos are safed by Safari and no longer access since two days now. Before it works perfect.
    The only real change who I do was to fix the permissions of a folder inside the Safari resources. The "German.lproj" folder. I do this, because I was not able to open the private settings in Safari. Each time who I click in the settings on the private option, Safari crashes. Anyway, since I add my profile to the permissions Safari works fine.
    I can't belive that this change is the source for the problem. I try to delete all related pagestuff in my keychane of OS X Snow Leo (10.6.8), repair the keychane and repair the permissions over the Disc Utility. I also remove my complete Safari profile in the Library to reset Safari, delete the preferences, delete Safari with Clean App and reinstall it, but still can't access my pages with a htaccess protection.
    All other pages working without any problem. All the pages are still available with other browsers.
    Anyone an idea what I can try next?

    OK, after a long time I solved my problem with the htacces and password protected pages.
    But let me explain a bit more, why it need so much time.
    After I post here at the board, I solved the problem over a simple resetting of Safari over the menu. After I do that, I got the login-window back.
    But for some strange reason I got the problem back after a longer time. And now I got the idea to look a bit deeper, what can happen. I open my Console from OS X and take a view on "All announcements". Now I hit enter in Safari to open the page who have a htaccess protection and I got some error results. On of them was this here:
    22.01.12 15:48:32
    Safari[1062]
    Unable to read contents in the Interface Builder file at path /System/Library/PrivateFrameworks/Safari.framework/Resources/German.lproj/Authe nticationPanel.nib due to error: Die Datei „AuthenticationPanel.nib“ konnte nicht geöffnet werden, da Sie nicht die Zugriffsrechte haben, um sie anzuzeigen..
    This message contain some german infos, so let me translate the last part.
    The file „AuthenticationPanel.nib“ can't be open, because you have not the right permissions.
    This error message looks like the big goal for me. I open this file-directory and mark the "German.lproj" folder to open the information panel for this folder. Now I go to the permission area, hit the "plus" button and add my profile / user to the permissions with a read and wrote permission. My new settings I transfer to all subfolders.
    Now the final test in Safari. I open the URL again and, tadaaaa, it works very well now.
    This is the same solution who I do before (see my first text on this posting) for the german.lproj folder. It looks like that Apples software like the Disc-Utility ignore the german folders around fixing the permissions or after an update or if you have trouble with the permissions.
    Anyway... This two manual fixings bring my access back and I'm now happy :-)

  • I can't connect to facebook. Keeps saying cannot connect to the internet but I am on the internet and can access web pages etc.

    I can't connect to facebook. It keeps saying cannot connect to the internet but I am connected as I can access we pages with no problem

    Hello there, Patrick.
    The following Knowledge Base article offers up some great steps to try when troubleshooting issues with an app you've downloaded to your iOS device:
    iOS: An app you installed unexpectedly quits, stops responding, or won’t open
    http://support.apple.com/kb/ts1702
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

Maybe you are looking for

  • Ftree package in Forms 9i

    In 6i you only have the ability to check if a tree element was selected or deselectd. You cannot check for right mouse click to set a popup menu. You cannot check fo BOTH selected/deselected and double mouse click. Very sad implementation. Has the ft

  • Automatically Setting Date and Time - How often does it occur?

    Can anyone tell me exactly when Mac OS X retrieves the date and time from Apple's time server? Quite often, the time on my Mac is several seconds out from the correct time. When I open the "Date and Time Preferences", it seems to sync up with the cor

  • Switching on external audio ejects external hard drives

    Hi folks. Weird problem here. I have an iMac (27-inch, Late 2012, 2.9 GHz Intel Core i5, 32 GB 1600 MHz DDR3) with a regular 3.5mm line-out jack going from the audio out port to an external speaker/subwoofer system. Whenever my mac is on and I have f

  • Standard IDoc processing in XI (WE20)

    Dear experts, when an IDoc is sent to XI, it's visible in transaction IDX5 and SXMB_MONI or Runtime Workbench. It's processed based on Integration Repository and Integration Directory configuration. Is it possible to enable standard IDoc processing i

  • Strange :Design Time Bean Customizer does not display

    hi,I write a cutomer validator rule and create beaninfo class,bean customizer class. and register as a rule ,it works very well.then I modify customizer class,when I want to add new rule on a entity,neither default define property nor my custormerize