How to redirect to home page on "Cancel" button click

Hi,
I have created a web part for office 365 developed using sandbox solution on Sharepoint foundation 2013.
On "Cancel" button click i want to redirect user to another page(Home page) using C# only.
i used some methods like 
Context.Response.Redirect(SPContext.Current.Web.Url.ToString() + "/Home.aspx");
but its not working. No methods which includes context or HttpContext is not working.
Please, tell me how can i redirect user to site home page.

Hi,
you can try this
var button
= new Button();
button.Attributes.Add("OnClick"
, "javascript:{window.location='your
page url';return
false;}");
this.Controls.Add(button);
Hope it helps!
Avni Bhatt

Similar Messages

  • How to redirect to different page after login in APEX 4.1

    Dear All,
    Here my Requirement is,When the users login,
    when they entered their username and password and pressed login button,
    they have to redirected to different pages based on the type of user.
    Here my LOGIN_TABLE has following 3 columns,
    1.Username
    2.Password
    3.Type.
    The TYPE has 2 values, employee and admin.
    when the type is admin they should be redirected to page 2,
    reaining i.e employee users has to be redirected to page 3.
    How can I do this? please give some suggestion.
    Thank you.
    regards,
    Gurujothi

    Dear Christian,
    Thank you for your reply,
    I would like to explain something,
    When I using the following function,
    *create or replace FUNCTION custom_auth_g (
    p_username IN VARCHAR2,
    p_password IN VARCHAR2)
    RETURN BOOLEAN IS
    BEGIN
    FOR c1 IN (SELECT 1
    FROM login_table
    WHERE upper(username) = upper(p_username)
    AND upper(password) = upper(p_password))
    LOOP
    RETURN TRUE;
    END LOOP;
    RETURN FALSE;
    END;*
    When login, It checks in the login_table table and if the username is exist with the pass word it successfully entered inside the application.
    for all users only one page which we set.
    My Login_table also contains type which has 2 type as I mentined above.
    But As I mentioned earliar based on the user type it has to be redirected to 2 different page.
    I found this Package but I cant understand,Can you please Explain?
    *create or replace PACKAGE app_security_pkg
    AS
    PROCEDURE add_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    PROCEDURE login
    p_uname IN VARCHAR2
    ,p_password IN VARCHAR2
    ,p_session_id IN VARCHAR2
    ,p_flow_page IN VARCHAR2
    FUNCTION get_hash
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    RETURN VARCHAR2;
    PROCEDURE valid_user2
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    FUNCTION valid_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    RETURN BOOLEAN;
    END app_security_pkg;*
    *create or replace PACKAGE BODY app_security_pkg
    AS
    PROCEDURE login
    p_uname IN VARCHAR2
    ,p_password IN VARCHAR2
    ,p_session_id IN VARCHAR2
    ,p_flow_page IN VARCHAR2
    IS
    lv_goto_page NUMBER DEFAULT 1;
    BEGIN
    -- This logic is a demonstration of how to redirect
    -- to different pages depending on who successfully
    -- authenticates. In my example, it simply demonstrates
    -- the ADMIN user going to page 1 and all other users going
    -- to page 2. Add you own logic here to detrmin which page
    -- a user should be directed to post authentication.
    IF UPPER(p_uname) = 'ADMIN'
    THEN
    lv_goto_page := 1;
    ELSE
    lv_goto_page := 2;
    END IF;
    APEX_UTIL.SET_SESSION_STATE('FSP_AFTER_LOGIN_URL');
    wwv_flow_custom_auth_std.login
    p_uname => p_uname,
    p_password => p_password,
    p_session_id => p_session_id,
    p_flow_page => p_flow_page || ':' || lv_goto_page
    EXCEPTION
    WHEN OTHERS
    THEN
    RAISE;
    END login;
    PROCEDURE add_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    AS
    BEGIN
    INSERT INTO app_users (username, PASSWORD)
    VALUES (UPPER (p_username),
    get_hash (TRIM (p_username), p_password));
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    ROLLBACK;
    RAISE;
    END add_user;
    -- Function to Perform a oneway hash of the users
    -- passwords. This cannot be reversed. This exmaple
    -- is a very week hash and if been used on a production
    -- system, you may want to use a stronger hash algorithm.
    -- Read the Documentation for more info on DBMS_CRYPTO as
    -- this is the supported package from Oracle and
    -- DBMS_OBFUSCATION_TOOLKIT is now depricated.
    FUNCTION get_hash (p_username IN VARCHAR2, p_password IN VARCHAR2)
    RETURN VARCHAR2
    AS
    BEGIN
    RETURN DBMS_OBFUSCATION_TOOLKIT.md5 (
    input_string => UPPER (p_username)
    || '/'
    || UPPER (p_password));
    END get_hash;
    PROCEDURE valid_user2 (p_username IN VARCHAR2, p_password IN VARCHAR2)
    AS
    v_dummy VARCHAR2 (1);
    BEGIN
    SELECT '1'
    INTO v_dummy
    FROM app_users
    WHERE UPPER (username) = UPPER (p_username)
    AND PASSWORD = get_hash (p_username, p_password);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN raise_application_error (-20000, 'Invalid username / password.');
    END valid_user2;
    FUNCTION valid_user (p_username IN VARCHAR2, p_password IN VARCHAR2)
    RETURN BOOLEAN
    AS
    BEGIN
    valid_user2 (UPPER (p_username), p_password);
    RETURN TRUE;
    EXCEPTION
    WHEN OTHERS
    THEN RETURN FALSE;
    END valid_user;
    END app_security_pkg;*
    And you said "assign an URL to FSP_AFTER_LOGIN_URL, depending on the Type column",
    Where to assign,Could you please Explain?
    Thank you.

  • How can I set home page for a new tab? how can i get firefox to open the home page every time i open a new tab in Windows vista home basic??

    How can I set home page for a new tab? how can i get firefox to open the home page every time i open a new tab in Windows vista home basic??
    == This happened ==
    Every time Firefox opened

    Firefox can have multiple home pages if you wish. Each home page that will open when starting Firefox is separated by the "|" character.
    See: http://support.mozilla.com/en-US/kb/How+to+set+the+home+page
    To have new tabs open a specific web site, add one of the following extensions:
    http://sogame.awardspace.com/newtaburl/
    https://addons.mozilla.org/en-US/firefox/addon/777

  • How to set multiple home pages, the option is gone (replaced my hard drive and had to reinstall firefox) This version seems to only offer tabs, not pages?

    My old version of Firefox had the option for me to set multiple home pages. My hard drive recently failed and had to be replaced, so I had to install the newest version of Firefox. The only option I see when I go to tools, options, general is to set the one home page. (and maybe tabs) I would like to open several of the same pages every time I open my Firefox. Does anyone know how to get this back, or which version had this feature so I can downgrade to that particular version?
    Also, I was wondering if there is a way to get the bookmarks I had on the old version back. I think they are lost forever, but if anyone knows, I would be thankful. I do still have the old hard drive, but the way it failed was actually when you tried to open any browser, the hard drive would go and blue screen, this is why the old hard drive had to be replaced. Thanks. :)

    So you mean you want to open new windows with the same page when you open Firefox?
    [[How to set the home page#w_set-more-than-one-website-as-your-home-page|Set more than one website as your home page]] should help if you want to open multiple pages when you open Firefox.
    As for recovering your bookmarks, you can try to plug that hard drive into a working computer, and then read [[Recovering important data from an old profile]] to copy your bookmarks from it. However, if it is failing you may not be able to do that.

  • How to redirect to other page in a dialogListener?

    Hi All,
    I am using JDeveloper 11g with ADF BC.
    How to redirect to another page from a dialogListener of <af:dialog>?
    I have a page with a [Delete] button on it. When user click on the delete button, a confirmation dialog will appear to ask "Are you sure? [Yes/No]". If user answer [Yes], I will delete the current record, and go to another page. I can call a Operation Binding in the dialogListener, but I don't know how to go to another page.
    public void handleDeleteDialog(DialogEvent dialogEvent) {
    OperationBinding operationBinding = bindings.getOperationBinding("Delete");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    // redirect to another page?
    Regards,
    Samson Fu

    Hi Samson,
    Check following link for your query:-
    Re: page has to navigate to the next page when  clicking button in the popup
    You can also make usae of Navigation Handler to invoke the navigation action in your task flow as
    FacesContext facesCtx = FacesContext.getCurrentInstance();
    NavigationHandler nh = facesCtx.getApplication().getNavigationHandler();
    nh.handleNavigation(facesCtx, "", "ActionNameInTaskFlow");
    Vikram

  • How to redirect a JSP page after the session is killed

    Hello!
    I am quite new to JSP. I have a question about how to redirect a jsp page after the session is killed. Could anyone help?
    thanks a lot in advance!

    You can't, directly. There's no connection betweenthe server and browser.
    even after invalidating the session. we can do it
    directly using the statement
    response.sendRedirect("....");
    or we can use the meta refresh tag.if session is invalidated and if we try to do response.sendRedirect(".. ") it throws IllegalStateException

  • Start page lacks menu items - unlike "How to set the home page" view

    I have just downloaded the beta of Firefox 4 and am attempting to reproduce opening home page from previous version. Directions on accomplishing this (loading the NY Times front page) depend on a menu bar with "File, Edit, View, History" etc. There are not visible. They are shown in the directions on Firefox Help but not on my computer. How to do this??

    Click the Firefox button, then click Options. This will open the options dialog that the [[How to set the home page]] article refers to.
    When viewing the support articles, in the right-hand column there is a section titled "Help With:", make sure it is set to Windows and Firefox 4 to get help relevant to the version you are using. In some articles you get different content when you select Firefox 4.

  • Have picture of apple on screen  how do I get home page from there ?

    have picture of apple on screen, how do I get home page from there ?

    It sounds like your iPod is frozen on the startup logo.  Have you tried a hard reset yet?  To do this, press and hold both the Sleep/Wake and Home buttons together long enough for the Apple logo to appear.
    See this article for more troubleshooting.
    http://support.apple.com/kb/TS3281
    B-rock

  • Firefox 4.01. I wish to have "Mozila Firefox S tart Page" as Start Page. I have used "How to set the home page" (tools, options, general, restory to default) but no result.

    # Numbered list item

    The part you are probably missing is
    When Firefox starts: "Start my Home page" (in the dropdown)
    the installed default home page is about:home in Firefox 4, but simply choose the "Restore to Default",
    then click on the "OK".
    see [https://support.mozilla.com/kb/How%20to%20set%20the%20home%20page How to set the home page | How to | Firefox Help]
    If that is not working then try instructions , and following the instructions suggest taking a picture of your toolbars first, so that you will be able to recustomize your toolbars afterwards, see [http://kb.mozillazine.org/Corrupt_localstore.rdf Corrupt localstore.rdf - MozillaZine Knowledge Base]
    After resetting, continue with [http://kb.mozillazine.org/Toolbar_customization Toolbar customization - MozillaZine Knowledge Base] and if you used small icons -- don't forget the checkmark for that in the dialog.

  • Why or how has my Firefox home page been changed to Pogo?

    My Firefox homepage has somehow been changed from Firefox/ Google to Pogo/ Yahoo. I don't know how or why. How do I return to the older format?

    See [[How to set the home page]] - Firefox supports multiple home pages separated by '|' symbols
    There are other things that need attention.
    Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.
    *Next Generation Java Plug-in 1.6.0_17 for Mozilla browsers
    Update the [[Java]] plugin to the latest version.
    *http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)

  • How come my firefox home page on my work PC doesn't look anything like my firefox home page on my home PC

    My home page on my home PC has weather, time, date and news and my home page on my work PC only has Google and search menu.

    Are the urls the same?
    You can have any page you want as your home page.
    * drag the favicon at the location bar to the home page button, see
    *:How to set the home page | How to | Firefox Help
    *:[https://support.mozilla.com/kb/How%20to%20set%20the%20home%20page#w_set-a-single-web-site-as-your-home-page https://support.mozilla.com/kb/How%20to%20set%20the%20home%20page]
    If they are both at Google, at home you probably have more time to play with Firefox and installed some Google applications. Others may not be actually installed. You are probably logged into Google like for GMail at home.
    When you bring up a Google application then you will see that application at
    the top of your Google page.

  • How to change the behaviour of the Cancel-Button of SSO-Login-Page (Forms)?

    Hi Folks,
    we use SSO-Login to authenticate users using Forms. How do I change the URL which is opened when a user clicks on the cancel button on the SSO Login page?
    In the formsweg.cfg file there is a parameter named ssoCancelUrl, but if I define it, it doesn't work anyway. Seems like it has something to do with ssoDynamicResourceCreate, but I don't exactly understand what.
    Can't I simply change the URL which is opened (globally), when a user hits the cancel button on any SSO-Loginpage.
    Thanks in advance.
    Regards.

    Exactly this does not work! Please watch my settings:
    Global Setting in formsweb.cfg
    # Single Sign-On OID configuration parameter: indicates whether we allow
    # dynamic resource creation if the resource is not yet created in the OID.
    ssoDynamicResourceCreate=false
    # Single Sign-On parameter: URL to redirect to if ssoDynamicResourceCreate=false
    ssoErrorUrl=
    # Single Sign-On parameter: Cancel URL for the dynamic resource creation DAS page.
    ssoCancelUrl=
    # Single Sign-On parameter: indicates whether the url is protected in which
    # case mod_osso will be given control for authentication or continue in
    # the FormsServlet if not. It is false by default. Set it to true in an
    # application-specific section to enable Single Sign-On for that application.
    ssoMode=false
    App-Specific settings in formsweb.cfg
    [proz]
    envFile=proz.env
    form=proz.fmx
    title=proz
    separateFrame=true
    width=1280
    height=960
    ssoMode=true
    ssoDynamicResourceCreate=false
    ssoCancelURL=http://machinename:port/zugangsportal/
    otherparams=useSDI=yes P_SERVER_URL=machinename:port P_REP_SERVERNAME=machinename_proz ZP_TARGET_ID=%ZP_TARGET_ID%
    When I now access http://machinename:port/forms/frmservlet?config=proz I got redirected to the SSO-Login-Page but the Cancel-Button still links to Middletier Home. Why?
    Regards.

  • How to get the home page for a user using  Pl/sql code ?

    Hi,
    I have a pl/sql procedure which runs after a form submission on a dynamic page. At end of completion of the procedure I want to send user to his/her home page. I am trying to write at the end of procedure to redirect the user to the home page. How do I do that ? What is way to redirect to a page using pl/sql and how do I know the user home page url ?
    thanks,
    Mainak

    Hi,
    Try <portalschema>.wwv_redirect.url('<portalschema>.home');
    Please replace portalschema with the name of your portal schema.
    Thanks,
    Sharmila

  • How to redirect to a page (without branching and without pl/sql)

    Hi,
    Have a requirement where when a user log into the application, the APP_USER must be checked against the list of users maintained in a database table, if APP_USER name exist in the table, the user must be redirected to the home page else user must be redirected to the Registration page.
    Tried the branching concept:
    Branch Point: On Load: Before Header
    Condition: NOT Exists (SQL Query returns no rows)
    Expression1 : select * from users_tab where name = v('APP_USER')
    When this condition is given, though the user name does not exist in the users_tab, the page is redirected to page 1 instead of the Registration page.
    Where is the problem here?
    How can it be resolved?
    Is there an alternative way to implement this?
    Edited by: 935799 on Jun 7, 2012 6:51 AM

    935799 wrote:
    Hi,
    Have a requirement where when a user log into the application, the APP_USER must be checked against the list of users maintained in a database table, if APP_USER name exist in the table, the user must be redirected to the home page else user must be redirected to the Registration page.
    Tried the branching concept:
    Branch Point: On Load: Before Header
    Condition: NOT Exists (SQL Query returns no rows)
    Expression1 : select * from users_tab where name = v('APP_USER')
    When this condition is given, though the user name does not exist in the users_tab, the page is redirected to page 1 instead of the Registration page.
    Where is the problem here?
    How can it be resolved?
    Is there an alternative way to implement this?
    Edited by: 935799 on Jun 7, 2012 6:51 AMThe above should work, try this
    select * from users_tab where upper(name) = nvl(:APP_USER,'X')

  • How do I get home page window to appear when opening FF?

    How do I get my homepage window to appear when I open FF?
    When I go to the dock and click on the FF icon,
    ''Firefox ''appears in the menu bar but there is no home page window showing. I have to go to ''File'' and select ''New Window'' to get to my home page window.
    In FF Preferences I have selected:
    "Show my home page" and the correct home page address is shown.
    I deleted FF application/program (dragged to trash can) and then re-installed it. That did not help.
    I occasionally use Safari and there is no problem with the home page showing right away when I open Safari.

    The file you need toi backup is name domain.sites2 and is located in your Users/Home() /Library/Application Support/iWeb folder.  Without that file you won't be able to continue to edit and maintain your website.
    However, remember this:
    NOTE: In Lion and Mountain Lion the Home()/Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    So if you're running Lion or Mt Lion you'll need to make that library visible before you can find and backup the domain.sites2 file.

Maybe you are looking for

  • "Comm Error" message when connecting to car stereo

    When connecting my 80G IPod to the port in my car, the IPod screen rolls horizontally, then says "OK to disconnect", and the stereo displays the "Comm Error" message. I was able to connect to the stereo before but don't know what happened to cause th

  • Dynamically create a type

    Hi, is it possible to create dynamically a type ? I take a look on class CL_ABAP_TYPEDESCR but i can't create a new type, so is there a solution ? Cheers

  • List Service Restored

    The Subject says it all. No need to reply. Thanks, Supportcuenet.com http://www.cuenet.com Infocuenet.com -= At the speed of the Internet =-

  • This is the "Help" AT&T gives its customers... Loyal at that!!! Read below

    So this is the "help" AT&T gives its customers after waiting a week... back to square 1! Read Below Hello Rafael, Thanks for your e-mail to AT&T. This email address has been discontinued. For questions about your AT&T service, please use one of the f

  • 503   Service Unavailable,SAP J2EE Engine/7.00

    Hi Experts, I have upgraded J2EE Software Components from SP06 to sp22 successfully. Components JSPM BASETABLES CORE-TOOLS JLOGVIEW SAP-JEE SAP-JEECOR SAP_JTECHF SAP_BUILDT BI_MMR KM-KW_JIKS ADSSAP CAF-UM SAP_JTECHS BI_UDI Now here is the problem...