0

I'm trying to create a new ID from a modal pop-up then close the radwindow and redirect to a page using the ID that was just created. I'm having a tough time trying to get this to work, can someone take a look and see if they know what I am doing wrong? I've spent hours on Google trying to find a solution, but nothing I find is of any help to me.

//this happens when the save button inside the radwindow gets clicked
    var pid = post.ID;
    this.AddClientScript("CloseAndRedirect(pid)"); // pass the parent ID into the javascript function  

//this function is in the Window.Master file where all radwindow functions are kept

function CloseAndRedirect(pid) {
        GetRadWindow().BrowserWindow.location.href = ("/Blog/Post-Maintenance.aspx?id=" + pid);
        GetRadWindow().Close();
    }

I just need to be able to add pid to the javascript function call so it can pass that variable to the new page that opens. With this code, I end up at a page with ?id=pid at the end of the URL. I'm not the best with javascript, but I tried adding '' and "" around the variable and just get a syntax error.

Thanks in advance for not judging my abilites. :)

1 Answer 1

1
this.AddClientScript("CloseAndRedirect("+pid+")");  

I think you should call like this inorder to get it working

Sign up to request clarification or add additional context in comments.

1 Comment

Perfect! Thanks! I'll accept this as the answer in a couple minutes, it won't let me yet. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.