Popup window and navigate to home page visual web part SP 2013

I've a visual webpart where i am inserting items in the list in the button click event as below
protected void btnSubmit_Click(object sender, EventArgs e)
SPSite site = new SPSite(SPContext.Current.Site.OpenWeb().Url);
SPWeb web = site.OpenWeb();
SPList list = web.Lists["Request"];
SPListItem item = list.Items.Add();
item["Title"] = txtBoxTitle.Text;
item.Update();
Now after items is being added in the list i want to show popup window with message showing that
"item has been inserted and click here to go to home page of the site"
how do i achieve this can anyone help in this
Note:there is a restriction in our requirement so only sandboxed solution can be used so i want resolution for sandboxed solution 

You can' t use criptManager.RegisterStartupScript for redirection in sandbox solution.
Please find the below reference
http://social.msdn.microsoft.com/Forums/office/en-US/bd37b640-e225-41c0-8344-9f3b52fe0434/open-popup-window-and-redirect-user-to-home-page-in-sandboxed-solution?forum=sharepointdevelopment
You have one more option to open a popup SP.UI.ModalDialog
Please find the below reference
http://msdn.microsoft.com/en-us/library/ff798375.aspx
http://blogs.msdn.com/b/chaks/archive/2011/09/14/modal-dialog-box-in-sharepoint-sandbox.aspx

Similar Messages

  • Fix - When I am in a website I keep getting redirected to a popup window or a generic home page

    I will click on a link to take me to my desired webpage. I will be reading it and within a few minutes, then either a pop up to do surveys will appear or I immediately loose my page and have been redirected to the general homepage. I am generally happy with firefox. Also when opening a new window, how can I get it so that it is my homepage that shows and not the generic homepage? Thanks

    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • Master Page Header and Footer in Page Viewer Web Part

    Hi.
    I created a View in Pages Library to view specific folders.
    After that i added one Page Viewer web part to one of the aspx page.
    There in the Page Viewer web part properties Link i have provided the url of the view.
    It is displaying the folders but at the same time it is displaying the master page header and footer inside the web part.
    Now i need to display the folders alone inside the Page Viewer web part.
    Please let me know how to exclude the master page header and footer inside the Page Viewer web part?
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

    I think that is the default behavior of the page viewer webpart.
    In the page viewer web part,your just enter the url of the website.So that is treated as webpage and it is displaying as per page.
    http://meritsolutions.com/meritmatters/archives/576-Displaying-a-File,-Folder-or-Web-Page-in-the-Page-Viewer-Web-Part.html
    If you want to display a folder, type in a network path to that folder under Link and the folder content will be displayed. 
    Find the more details about page viewer webpart in msdn
    http://office.microsoft.com/en-in/sharepoint-server-help/page-viewer-web-part-HA010024045.aspx

  • Sharepoint 2013 Visual Web part Deloyment

    Hello,
    I built a visual web part(sharepoint 2013) using visual studio 2012. But when I tried deploying, I got this error message:
    "Error occured in deployment step 'Activate Features': Feature id '****' is not installed in this farm, and cannot be added to this".
    Approaches I made to fix this :
    1) Tried changing the scope of Feature to Farm/Web/WebApplication
    2) Tried installing feature manually using Install-SPFeature -AllExistingFeatures
    3) Tried resetting IIS
    None of these attempts helped me. Can someone help me on this ?
    Thanks
    KG

    Hi,
    According to your post, my understanding is that you get error while deploying the visual web part.
    To narrow down whether the issue is related to the project itself, you can do some steps as below.
    Re-open the visual studio, create a new clean project with a simple visual web part then check whether it works.
     What’s more, you can check whether feature assembly is register in GAC or not. So try to uninstall feature and use below command: (if have not done before)
    Install-SPSolution -Identity MYfeature.wsp  -GACDeployment -force
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Open popup window and redirect user to home page in sandboxed solution

    i've created a sandboxed solution visual webpart and it has submit button so when user fills the information in the text boxes availble in webpart and clicks submit button so I want to open popup button containg success message and ok button so when user
    clicks ok button in popup window i want user to be redirected to the home page of the site.
    i tried to open popup and showed success message by below code
     string gotohomepage = "http://sp2013:1111/Pages/home.aspx";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('Your Record has been submitted successfully,you will be redirected to home Page shortly');location.href =
    '" + gotohomepage + "';", true);
    but it's not opening popup window can anyone help how do i open popup window and redirect user to home page in sandboxed solution

    Page class and script manager are not supported in sandbox solution
    You can create model popup to achieve this
    below are the reference links
    http://blogs.msdn.com/b/chaks/archive/2011/09/14/modal-dialog-box-in-sharepoint-sandbox.aspx
    http://social.msdn.microsoft.com/Forums/en-US/9427db4d-60f2-4b2a-8db6-b50d01ac4f23/how-to-create-modal-popup-using-sandboxed-solution

  • Load page in popup window with different (from parent page) browser

    Hi,
    Environment: Windows XP or Windows 7, Visual Studio 2010, Internet Explorer 8 (IE)
    I have an application which opens page containing HTML editor.  Here you can edit a document (pooled from db). Next, btnPreview opens a new popup window and shows changes you made via Internet Explorer (IE - default browser).
    Here is original code - works OK when you run from both - VS 2010 (http://localhost:50827/NCSite/MenuEditor.aspx) or via browser IE (http://localhost/NCSite/MenuEditor.aspx).
    Please pay attention - with VS2010 was used a dynamic address (localhost:50827) created by VS2010
    Here is a code I used for that:
    URL = Request.Url.Scheme +
    "://" + Request.Url.Host + appPath + URL;
    ClientScriptManager cs = Page.ClientScript;
    cs.RegisterStartupScript(this.GetType(),
    "NewWindow",
    "<script>window.open('" + URL +
    "', 'New')</script>");
    Now I have a request to add two more buttons to preview in Google Chrome (GC) and Mozilla Firefox (FF).
    I used next code:
    using System.Diagnostics;
    //for btnIE:
    URL = Request.Url.Scheme +
    "://" + Request.Url.Host + appPath + URL;
    Process.Start("iexplore",
    URL);
    //for btnGC:
    URL = Request.Url.Scheme +
    "://" + Request.Url.Host + appPath + URL; 
    Process.Start("chrome",
    URL);
    //for btnFF:
    URL = Request.Url.Scheme +
    "://" + Request.Url.Host + appPath + URL; 
    Process.Start("firefox",
    URL);
    It works OK when you run from VS2010 (http://localhost:50827/NCSite/MenuEditor.aspx)
    but when you open application via default browser (IE) and after editing document press btnIE, btnGC, or btnFF it is not creating a new popup window and simply replacing existing window
    and shows updated document via IE.  Processes for GC and FF not even started (looked through Task Manager).
    Is it any way to solve that issue?
    Thanks,
    Dm
    dmirkin

    Hi dmirkin,
    If Andy's suggestion still cann't resovle your issue.
    You are more likely to get more efficient responses to
    ASP.NET issues at http://forums.asp.net where you can contact ASP.NET
    JavaScript experts. This forum is for web application.
    Thanks,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Close popup window and refresh the parent window

    Hello,
    I have a button in a normal report, when clicked opens up an popup window which is a form containing some items and here in this form (i have some editable text items) I make some changes and click on the apply changes button -- this should update the form, close the popup window and should refresh the parent window.
    can anyone please help me out with this issue.
    Thanks,
    Orton

    you have your popup window. When they apply the changes you want it to close the window, right?
    Modify the button (save, apply changes) and give it url redirect to the custom function you create (See below): javascript:saveChanges();
    in the page header, add a new function:
    <script type="text/javascript">
    function saveChanges(){
         doSubmit('SAVE');//this is the line to save the current form on the popup window. (This assumes SAVE is the request value that should udpate the db)
         window.close();//close the popup window
         window.opener.doSubmit('REFRESH');//call doSubmit function on the parent window to cause the page to refresh.
    </script>

  • Javascript to open popup window and disable parent window

    Hello,
    Can anyone please help me the javascript issue.
    I have a button which opens up a pop window and when this popup window is opened i want to disable the parent window and enable it when i close the popup window.
    can anyone please help me with a possible approach.
    Thanks,
    Orton
    Edited by: orton607 on Aug 25, 2010 2:19 PM

    jari,
    I have a problem with this modal window approach and I have noticed. The thing is I am able to open up a popup window which is a simple data entry form. In this form i have the button Create which calls a javascript function and then an pl/sql insert process.
    Below is the javascript function for the button create
    function createNew()
    doSubmit('CREATE');
    alert('Successfully inserted the record. Click OK to close popup window and to \n view details of the new inserted record please select the table on parent window.');
    window.close();//close the popup window
    window.opener.doSubmit('REFRESH');
    //call doSubmit function on the parent window to cause the page to refresh.
    }The problem, i have is when i open up a popup window in this window when I click on the create button, its again opening up a new empty window. i don't understand what might be the problem.
    can you please help me out with this one.
    thanks,
    orton
    Edited by: orton607 on Aug 25, 2010 4:19 PM

  • I accidently "x" off the download of firefox 4 before it had finished and now the home page doesn't work, i tried redownloading firefox but that didn't work is there a way i can resume the download?

    I accidently "x" off the download of firefox 4 before it had finished and now the home page doesn't work. it loads but then wont let me search from it? i tried redownloading firefox but that didn't work is there a way i can resume the previous download?

    Your More system details list show that you run the latest Firefox 4.0.1 version.<br />
    You can check that via Help > About Firefox and on the Help > Troubleshooting Information page.
    A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process.
    See:
    * https://support.mozilla.com/kb/Server+not+found
    * https://support.mozilla.com/kb/Firewalls
    If you posted from another computer then download the full version and uninstall the currently installed version.
    Download a fresh Firefox copy and save the file to the desktop.
    * Firefox 4.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Uninstall your current Firefox version.
    * Do not remove personal data when you uninstall the current version.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    * It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    Your bookmarks and other profile data are stored elsewhere in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder] and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.

  • How can I get the cursor to appear in the main search window on the Google home page by default?

    The cursor in my Firefox appears in the address bar. I would like it to appear by default in the main search window on my default home page, Google.com. How?

    This is all very Greek to me. Is it really this hard just to get the cursor to appear in the main search window when Google.com is one's default home page?
    I don't really know much about Firefox extensions. My list includes Adblock Plus 1.3.8; Duplicate This Tab 1.2; Java Console 6.0.25; Java Quick Starter 1.0; Microsoft .NET Framework Assistant 0.0.0; New Tab Homepage 0.4.3. Nothing unusual is indicated for either Java item, Console having been updated 4/27/2011.
    What to do next?
    Thank you.

  • Have Firefox home page set for Google search, but each following tab opens w/Yahoo search instead. How do I remove the Yahoo and have Google home page on every tab????

    As I said above: I Have Firefox browser home page set for Google search, but each following tab (but suddenly now it) opens w/Yahoo search instead. How do I remove the Yahoo search off the added tabs and have Google home page/ blank tab (like it used to be) on every tab????

    The new Firefox Start Page - '''about:home''' - isn't the same homepage that was used in earlier versions of Firefox - http://www.google.com/firefox There is no "setting" for the "Search Container" on the about:home "page" - in the Options UI or in about:config .
    Set that old "Mozilla Firefox Start Page" as your "homepage". <br />
    http://support.mozilla.com/en-US/kb/How+to+set+the+home+page
    Or open your Profile folder and delete the '''webappsstore.sqlite''' file and hope the "Search Container" on the about:home "page" returns to Google. When it '''''is''''' Google, the Google logo appears to the left of the "Search Container"; when the search engine there has been changed to something else, there is no logo to the left of the "Search Container" - AFAIK.

  • I am having trouble with my mac book air. I think I have a virus because everytime i click on a link it openes up popup windows and other things. How do I reset teh computer?

    I am having trouble with my mac book air. I think I have a virus because everytime i click on a link it openes up popup windows and other things. How do I reset teh computer?

    Please post a screenshot that shows what you mean. Be careful not to include any private information.
    Start a reply to this message. Click the camera icon in the toolbar of the editing window and select the image file to upload it. You can also include text in the reply.

  • Javascript to Display message and return to home page

    Hi
    I have a requirement to display an acknowledgement message after a button has been pressed and return to home page.
    I created some JS and tested on a standalone button.
    <script type="text/javascript">
    function GoToHome_ack()
    alert("Authorisation Created!");
    // goto to page 1
    location.href = "f?p=&APP_ID.:1:&SESSION.";
    </script>
    Now the problem is I need to call this code after I have successfully executed 2 Processes conditionally on a Create Authorisation Button
    The only logical place I tried to place the call was on the conditional Branch URL, because I need the Processes to execute first.
    javascript:GoToHome_ack();
    Unfortunately this failed
    Anybody any suggestions ??
    Regards
    Ade

    Hi,
    Quickly what come my mind is that create blank page and place to HTML header
    <script type="text/javascript">
    alert("Authorisation Created!");
    // goto to page 1
    location.href = "f?p=&APP_ID.:1:&SESSION.";
    </script>Then branch to that page instead javascript:GoToHome_ack();
    br, Jari

  • TS1398 safari shuts down and goes to home page after 6.1.2, any body else ?

    Safari shuts down and goes to home page on some web sites after 6.1.2 install, any body else have this issue ?

    Safari shuts down and goes to home page on some web sites after 6.1.2 install, any body else have this issue ?

  • Open popup window and bring text to opener window jsp [help~]

    how to click a button then open popup window.
    and add somthing in the popup window, that can bring the text in the popup window to opener window in jsp.

    This is a javascript/html question, and has nothing to do with Java/JSP.
    You could do it with plain javascript/html using window.opener.
    I would recommend using something like a [YUI 2 Panel|http://developer.yahoo.com/yui/container/panel/] to do it.
    Opening new windows is a thing of the past.

Maybe you are looking for

  • Problem after creating a module !!!

    Hi Experts, I was trying to put my hands on EJB development and took the help of the paper "Step by step guide to develop a module for reading file name in a sender file adapter" by Krishnakumar Ramamoorthy. Now that everything was developed and depl

  • Smart objects become pixelated when re-scaled?

    I have Photoshop CS5.5 running on Windows 7 Home Premium 64bit. When I place vector objects from Illustrator and then go to re-scale them they become pixelated. I check the Anti-alias box before commiting the place, but they still pixelate when re-sc

  • An exception occurred while reading or writing from/to the IIS server

    Hi All, I am trying to install and configure calendar connectivity in EP6 sp9. As mentioned in http://help.sap.com/saphelp_nw04/helpdata/en/1d/3d59fdaa5ebb45967ea107d3fa117a/frameset.htm, i have installed MSX-A component and On testing MSX-A Componen

  • Performance Update 1.0 Problem?

    Since performance update 1.0, my macbook pro (15.4" Mid 2009 3.06 Ghz, 500Gb), has been experiencing stalls more frequently than before, and recently just crashed. I checked the Terminal as I had a software build running only to discover that none of

  • Menu button frozen cant access playlists

    I recently purchased an Ipod dock and have been unable to access my playlists since I used it. The menu button works as it makes the light come on but it is not letting me into my menu or at my playlists. My ipod is now just playing all the songs in