How to redirect user on or before page load

Hi,
what is best practice for redirecting a user when he opens a specific page.
I have a solution with a custom master page and several webparts. When a user opens my solution (every page based on the same master). 
What i need to do now is, when the user opens the page i have to check before rendering the page and the webparts some criteria. When the user is not allowed to open the page i need to redirect him to another location.
How could q redirect a user in a sharepoint solution?
I thought about some ways:
- develop a webpart (without any rendering) and put in onprerender event the check and the redirect
- create a codebehind for the masterpage
- create an httpmodule
What would you prefer? How could i solve it?
Best Regards
Bog
Developers Field Notes | www.bog1.de

Hi,
In SharePoint on-premises, I suggest you use HttpModule and HttpHandler to achieve it.
http://sharepointgotchas.wordpress.com/tag/httpmodule/
http://zoomsharepoint.blogspot.com/2009/09/redirect-page-using-http-module.html
In SharePoint online, JavaScript is a better choice, we can add some JavaScript code in the master page.
http://sharepointtipsntricks.blogspot.com/2009/06/redirect-to-another-aspx-using.html
Best Regards
Dennis Guo
TechNet Community Support

Similar Messages

  • How to redirect user from login page to "Set Challenge question" page

    How to redirect user from login page to "Set Challenge question" page (NOT custom page) after 3 un successful password attempts?
    Meaning when user types wrong password 3 times they will be redirected to set Challenge question page. If user answers the challenge question then password reset page should be appeared other wise (after remaining 3 un successeful challenge question answers) account should be locked out.
    thanks for your help.

    hi sandeep
    Thanks for your answer. Let me ellaborate more on the requirement here.
    - Password Policy and Lost Password management are set up in the identity system
    - Configure login tries allowed= 5. Verify accout is lock out after 5 unsucessful login.
    This is what need to achieve.
    1) If a user attempts to login 3(not 5) times using an incorrect login credential he/she should be redirected to set challenge question (security question) page.
    2) Then if the user attempts (remaining) 2 times incorrect challenge answer then his/her account should be locked out.
    3) If he/she answers the challenge answer correctly then he/she should be redirected to password reset page.
    Is this possible?

  • How to Set icon/image programatically in ADF before page loads

    This is my UI:
    Depends on the condition i want to set icon/image programatically in my java code.Before page load im calling this method.
    So i couldnt take binding value also,it throws null pointer exception.Then i tried setting icon/image programatically.
    <af:commandImageLink text="settings" icon="#{bean.iconsettings}" binding="#{bean.bind}"> </af:commandImageLink>
    My bean:
    private RichIcon iconsettings;(its getters and setters)
    private void method(){                         // method
    if(cond){
    this.iconsettings="/images/20.jpg";   //trying to set icon in a string.but it throws me error that cannot set RichIcon to string.
    else
    this.iconsettings="/images/19.jpg";
    Could any one tell me how can i set icon/image in java code.Before page loads im performing all above said tasks.Please help.

    Well, you set the icon property to a bean method, which you have done. The bean method however need to have the signature
    public String getIconsetting()
    // your code returning hte path to the icon
    if(cond){
         return ="/images/20.jpg";   //trying to set icon in a string.but it throws me error that cannot set RichIcon to string.
    else {
         return ="/images/19.jpg";
    The bindproperty is not needed, remove it and remove the RichIcon Iconsettings too´as it's not needed to and is the wrong type anyway.
    Timo

  • How to manage wait time in between pages loading

    Hi,
    Could you please help me "How to manage wait time in between pages loading while playback script using etester?
    Thanks,
    RJ.

    RJ
    You can edit the think time in eTester by:
    Expand the tree node and right click on the address bar to select Address Properties, you can then edit the text box called Delay Before PlayBack
    If you like to specify think time between actions instead of action groups: right click on the actions ans select properties, there are 2 text boxes in the new window; one for milliseconds and the other for seconds
    Hope this helps
    Alex

  • How to redirect users to certain page on login

    Hello All,
    I need to redirect users to page 1 after login even if they use a direct URL pointing to some other page. How do i achieve this?
    Ex:
    User logs in using URL:
    http://localhost:port/apex/f?p=101:10:1818843916449354::NO:::should redirect him to below page instead of 10:
    http://localhost:port/apex/f?p=101:1:2314843916462565::NO:::Appreciate your reply.
    Thanks and Regards,
    Senana

    Hello Senana,
    Assuming you're using wwv_flow_custom_auth_std.login to log in, and p_flow_page is set to "[your app id]:1" try placing the following line just before your call to wwv_flow_custom_auth_std.login:
    :FSP_AFTER_LOGIN_URL := null;This should force user to page 1 after log-in.
    Hope this helps,
    John

  • How to redirect users to Custom Page on InfoView logoff

    Post Author: Srinivas123
    CA Forum: WebIntelligence Reporting
    How to redirect the users on InfoView logoff to a custom page, instead of the default logon.aspx.   

    Hello Senana,
    Assuming you're using wwv_flow_custom_auth_std.login to log in, and p_flow_page is set to "[your app id]:1" try placing the following line just before your call to wwv_flow_custom_auth_std.login:
    :FSP_AFTER_LOGIN_URL := null;This should force user to page 1 after log-in.
    Hope this helps,
    John

  • How to redirect users to different pages after logging in?

    Please HELP this is doing my head in.
    I have created a login for a site using dreamweavers login tools, but I need to direct users to their individual pages, as Dreamweaver shows only one.
    I here you can store urls in you data base then call on them depending on the user is this correct ?
    Or is there another way ?
    Could someone show me what I need to do ?
    Any help would be appreciated
    Dazza

    Hi
    It would become a long reply if I showed you, and I would require your database structure. So this is a simple 'things to do / steps to take' list.
    (the access level and user id, (not the same as database table id) are used interchangeable here)
    The first item is to ensure you have your database set-up to allow the items to be recovered from it dependant upon the users id/access level. This could be done via a simple access level being set, the access level would be set in the user table and the page content from the database would have a matching column in the table for content.
    The DW authentication server behaviour will set the access level in the same session variable at the same time as the logged-in session is set, (see the DW documentation on user authentication for how to use this feature).
    It would then be a simple matter of retrieving the information for the page using the DW recordset query server behaviour, which can also automatically set the access level in the query code to ensure that the items to be retrieved matches the access level.
    The biggest problem most people who try to set-up a restricted access section of a site, is not the server behaviour to restrict access to content, but the cms section of the site to create the content as required. For this is may be worth while reading - http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html, although your database code would be slightly different as you would require the access level/user id be used to 'filter' the results returned and the items for the user to view, (links to content) also must be access level/user id dependant, (tip, use conditional region code for this).
    PZ

  • How to redirect to a server busy page when under heavy load

    Hello,
              I have been doing extensive load testing of a web application using Weblogic
              5.10 sp 06. I have found a point where under extremly heavy load the server
              just does not respond anymore. Fair enough.
              What I want to do is at a certain load level (before it stops responding) I
              want to redirect users to a "Server Busy - try again later" page. Is there a
              setting in weblogic that allows me to do this ? Or do I need to have other
              monitoring software to take care of this ?
              Thanks and Regards,
              Nick H
              

    Cameron Purdy <[email protected]> wrote:
              > Hi Nick,
              > Unfortunately, last I check there was no such processing. Weblogic maintains
              > a big (2^16) queue that it puts requests into and (if I remember correctly)
              > it doesn't gracefully handle overflow. I believe the architecture should
              > have been a smaller queue with the overflow condition being
              > protocol-specific (such as HTTP doing a "too busy" error).
              It is possible to create and use your own execute queue in 6.1 and specify it's
              length, so I expected this to happen when queue length reaches this number, but
              it didn't.
              > Peace,
              > --
              > Cameron Purdy
              > Tangosol, Inc.
              > http://www.tangosol.com
              > Tangosol: How Weblogic applications are customized
              > "NH" <[email protected]> wrote in message
              > news:[email protected]...
              >> Hello,
              >>
              >> I have been doing extensive load testing of a web application using
              > Weblogic
              >> 5.10 sp 06. I have found a point where under extremly heavy load the
              > server
              >> just does not respond anymore. Fair enough.
              >>
              >> What I want to do is at a certain load level (before it stops responding)
              > I
              >> want to redirect users to a "Server Busy - try again later" page. Is there
              > a
              >> setting in weblogic that allows me to do this ? Or do I need to have other
              >> monitoring software to take care of this ?
              >>
              >> Thanks and Regards,
              >>
              >> Nick H
              >>
              >>
              Dimitri
              

  • Redirect user to a different Page based on number of  Liquid output result

    I want to redirect the user to a different page based on the number of results. I have some multi-account users and single account user in my secure zone. I want single account users to be sent to a different page, while multiple account user should be shown their accounts and they user can now click the account he/she wants to access. This is my code:
    {module_data resource="customers" fields="company, email1"  where="\{'company':\{'$contains':'{{this.globals.user.email}}'\}\}" skip="0" limit="500"  version="v3" collection="companyXtra" template=""}
    {module_webapps id="21927" filter="all" collection="companyAccess" template=""}
    {% for item in companyAccess.items -%}
    {% assign counter = {{forloop.length}} -%}
    {% if globals.user.email = item.email and counter = 1 -%}
    <script>
    window.location.replace("/single-account-user.html");
    </script>
    <a class="w-inline-block szone-navlinks multiplecoy" href="{{item.url}}">
        <div class="szone-holder">
          <div class="szone-narrate addenrolee">{{item.name}}</div>
        </div>
      </a>
    {% else %}
    <p><a href="{{item.url}}">{{item.name}}</a></p>
    {% endif %}
    {% endfor %}
    </div>
    Please what I'm doing wrongly. Can someone kindly assist. Thanks.

    Hi Liam I have since been reviewing my query using the BC API Discovery which has been a good guide for me. But the result is just displaying the core customer's company, though the other company has a default email/email1 as the core customer.
    This is my new query:
    {module_data resource="customers" version="v3" fields="company" skip="0" limit="10" where="\{'email1.value':\{'$contains':'{{globals.user.email}}'\}\}" order="id" collection="myData"}
    <pre>{{myData|json}}</pre>
    This is the json:
      "moduleName": "data",
      "moduleDescriptor": {
      "templatePath": null,
      "parameters": "resource=\"customers\",version=\"v3\",fields=\"company\",skip=\"0\",limit=\"10\",where=\ "\\{'email1.value':\\{'$contains':'[email protected]'\\}\\}\",order=\"id\",collection=\"myData\"",
      "apiEndpoint": "/api/v3/data",
      "objectType": "-1",
      "objectId": "-1",
      "adminUrl": ""
      "items": [
      "company": "The vivove company Limited"
      "totalItemsCount": 1,
      "skip": 0,
      "limit": 10,
      "params": {
      "resource": "customers",
      "version": "v3",
      "fields": "company",
      "skip": "0",
      "limit": "10",
      "where": "\{'email1.value':\{'$contains':'[email protected]'\}\}",
      "order": "id",
      "collection": "myData"
    I expected to see two companies. This is screenshot of my the companies in the CRM:
    Screenshot by Lightshot
    Screenshot by Lightshot
    Thanks. most appreciated.

  • How to enable users to personalize their pages?

    Dear all,
    Are there any tools or built-in functions which I can make uses of so that users can personalize their pages?
    It seems very attractive if I can provide this value-added features to users.
    Thanks
    George

    Hi jeena:
    It seems that everyone is trying to help but lacks some vital information such as:
    1) Is your web page on the Internet or on a local area network?
    2) If it is on the internet, can you provide a link so we can take a look and see what might have gone wrong?
    3) If not, how did you get your web page up so that other people can access it.
    Essentially, the xls file that you're referring to shoud be in the same location as the html file if it is on the internet but this is not mandatory since you can create a link that lets the user download anything from anywhere on the internet -- as long as the file is there somewhere.
    If you're on a local area network, the fact that the xls file is on the same computer doesn't mean that it's downloadable. For example, if you use MicroSoft Personal Web Server, your html file is avaible to other people on the network only if you have it copied over to the designated sub-directory of Inetpub and the xls file has to be copied there as well.
    So......to make a long story short, give us more info!
    V.V.

  • Before page load

    Jdev 11.1.2.3.0
    1.     I have a method in a java class which I wanted to execute shortly before the page loads.
    2.     Also just like above, I have another method in a java class which I wanted to execute before control passes to an input Text,
    How do I call these methods?

    Thanks,
    1)  I have already implemented my case using method call however, I was thinking that there might be another way to do that.
    2) The use case here is that I have some input Text items, when a user navigates to an inputText, the value will be autofill. For Instance, I have a two fields, one with the surname and the second with the first name. When a user navigates to the full name field, it will fill it with the concatenation of surname and first name fields.

  • Progress Bar before page loads......

    Hello -
    I'm able to make progress bars for loading images on the
    screen, but I'm having a hard time figuring out how to make one
    appear before the entire page loads. Do use the Loader component as
    the entire page and have my flash file load into it? I'm pretty
    sure there is an easier way by using actionscript, but my coding
    skills are average........
    Any help or suggestions on this would be greatly appreciated.
    I did do a search on this subject and found a few hints, but not
    everything.
    Thanks again.

    I tried this coding and for some reason I didn't see the
    progress bar before the page loaded. I'm assuming it has something
    to do with the "visible=0" line. I messed around with that, and
    still had no luck. See if I overlooked a small detail. Thanks
    Kglad.
    That url (in the code) will work if you want to try it.
    loadMovieNum("
    http://www.trance-state.com/equipment.swf",2);
    preloadI=setInterval(preloadF,100);
    function preloadF(){
    bl=_level2.getBytesLoaded();
    bt=_level2.getBytesTotal();
    if(bl==bt&&bl>0){
    clearInterval(preloadI);
    _level0._visible=0;
    } else {
    // put code here to update your progress bar and anything
    else you want using bl and bt
    }

  • Dialog Box Open before Page load using af:CommandNavigationItem

    Hi,
    I have a CommandNavigationItem menu, the requirement is simple.
    Use Case:
    1. On click of one of the menu item, i need to display a message or prompt user to select "OK" or "Cancel"
    2. If user clicks "OK" will navigate to the require page. and "Cancel" will stay on the page.
    I have used couple of things like, creating a af:popup with a af:dialog and calling this popup from managed bean on page load, it works fine get a popup with a "OK" "Cancel" text. But the problem is it opens the popup fine but the parent page get loaded also.
    Please help me to find any solution? Will appreciate your time!!
    Thanks
    Neeraj Halder

    thanks vinod,
    I have tried but struggling with binding of the popup.
    1. let say when i login to my application my first page is "homeView.jspx", so on homeView.jspx i have written the code for popup.
    2. And in the menu i have "home" and "details", so when i click the "details" menu this popup should open, and on clicking ok it should navigate me to the Details page, as you suggested ActionListner for that.
    Please see below what i have done till yet.
    ActionListener Code:
    /*code in jsp
    actionListener="#{backingBeanScope.testViewBean.checkOnClickofDetails}"
    /* code in java with a backing bean scope
    private RichPopup validationMessageDialog;// popup id
    public void checkOnClickofDetails(ActionEvent actionEvent) {
    RichPopup.PopupHints popupHints = new RichPopup.PopupHints();
    getValidationMessageDialog().show(popupHints); //
    popup in homeView.jspx
    <af:popup id="validationMessageDialog"
    binding="#{backingBeanScope.testViewBean.validationMessageDialog}">
    <af:dialog id="d3" cancelTextAndAccessKey="cancel"
    dialogListener="#{backingBeanScope.testViewBean.loadDetails}"
    title="Prompt">
    <af:outputText value="#{msg.AGENT_NOT_FOUND}" id="ot3"/>
    </af:dialog>
    My doubt is i am doing something wrong with the scope of the managed bean. in the above code i have used backing bean scope,
    let say i have a java file example ABC.java, which is a backing bean scope given in adfc-config.xml. can i use this one java file for two of three different jspx as a backing bean? Hope i am clear here? :)
    2) when we create a jspx and its backing bean at a time, is there any internal mapping happen apart from adfc-config.xml that one jspx will have only one java file as a backing bean?
    Sorry if i am making this more complicated, above question comes because, when i move the same popup code in "Details.jspx" page and at the time of creation of this page i have created backing bean also so when i calling this function on page load "checkOnClickofDetails" which is in the Details.java (backing bean) the popup comes fine. but unfortunately cannot use this because parent page get laoded with this popup also.
    let me know if i am doing something wrong?
    Thanks,
    Neeraj Halder

  • How to use the Observer when a page loads

    Anybody know how to use the
    Spry.Utils.addClassName('DivName','selected') and then fire the
    Spry.Utils.addClassName with onLoad?
    I am loading a page with the selector utils in it into a div
    and then I think I must need an Observer to get the
    Spry.Utils.addClassName to work when this page loads in a div.
    Any help would be greatly appreciated.
    Thank you,
    Bisser.

    I added Spry.Utils.addClassName('DivName','selected') in the
    Script after the constructor and after the effects and it works
    fine. Thank you for your help to get me going.
    Well after the fact, this solution was a problem because it
    loads the selector each time I loaded the file.
    kinblas had the correct answer that I was looking for.... as
    it loads the selector as a 3rd argument.
    ie:
    Spry.Utils.updateContent('mainDIV','/menu.php', function() {
    Spry.Utils.addClassName('DivName','selected'); });
    Thanks to both of you for your continued support.
    Bisser.

  • How to hide business process stage on page load in crm 2013

    Please tell me how to hide process stage on page load in crm 2013.
    for example: Develop, Propose,Quotation... these are business process stages and I have a custom field named "type"
    If type value =1 then hide Propose stage

    Hello,
    That is not possible. What I would suggest is to create several processes for same entity and switch between them using plugin. Sample code for it -
    https://deepakexploring.wordpress.com/tag/updating-process-id-in-crm-2013/
    Dynamics CRM MVP/ Technical Evangelist at
    SlickData LLC
    My blog

Maybe you are looking for

  • Refresh has effect on clone but not on object itself

    Hi, (Using TopLink 9.0.3 with an Oracle Database) I see some mystifying behaviour when I insert an object, refresh it because I know the database performs some changes on the data during insert from a database trigger and then inspect the refreshed o

  • Recently bought a new HDD, and encrypted it, and it no longer works on any machine, help?

    Recently bought a new HDD, and encryped it and it no longer works... Does anyone have any idea how or why? I can't seem to press anything except repair and verify...

  • What to specify in my JDBC receiver communication channel

    Hi! In my Receiver comm channel I have selected Adapter Type:JDBC     Receiver Transport protocol: JDBC 2.0 Message Protocol: XML SQL Format Adapter Engine: Integration server JDBC driver:?????? Connection: ?????? I dont have any idea as what to give

  • Using TabbedPanels widget to make photo album

    I was pondering upon a nice tutorial here at Adobe - really good, but it used Dreamweaver 8 (while being written at CS3 era) and a lot of efforts to be done by hands - about the ways to create a photo album using built-in Dreamweaver CS4 Spгy feature

  • Option click with mouse?

    This is my last question for now. I'm playing an online puzzle challenge at Gold Rush. And for the puzzle for Mac users, you need to option click to alternate the puzzle pieces. How do you option click with the Mighty Mouse?