0

I have followed the below article in order to create some custom new/edit/view forms for a list

(http://ranaictiu-technicalblog.blogspot.in/2011/06/sharepoint-custom-addeditdisplay-form.html).

Now in my newform.aspx page I have a submit button. Once I click that button I need to redirect to another page.

Problem here is that while the redirecting the new page is opening in a popup window. How can I open it in the current window?

Script used is below:

 private void PopupSendMail(string msg)
        {              
          string js = "<script language='javascript'>
            alert('" + msg + "');
            function load_url(externallink){
             window.open(externallink,target='_blank')}load_url('"+ mySiteWeb.Url +"');</script>";
            ClientScript.RegisterClientScriptBlock(GetType(), "Register", js);
        }
  • Sorry - I'm not sure of what you want to achieve. Right now the page opens in a "popup window" but you want to open it as a "new window"? What is the difference? Do you intend to use the SharePoint modal dialog? – Hitodama Aug 6 '13 at 10:17
  • I want to redirect a page when user clicks on save button.. for example google.com. but here it is opening google.com in model popup? – santosh kondapalli Aug 6 '13 at 11:18
  • so you actually want to open the link in the same page? – Hitodama Aug 6 '13 at 13:19
  • yes i want to open the link in a same page but not in a popup – santosh kondapalli Aug 6 '13 at 13:36
0

If I understand correctly, you need to open the page in the same window, while right now it is opening as a popup?

If this is the problem, just modifiy the target of the window.open command. Right now you have:

window.open(externallink,target='_blank')}

turn that to

window.open(externallink,target='_self)}

As you can see here "_blank" means that the url opens in a new window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.