I have a SP2010 site and I am trying to open a modal dialog as a result of a button click.
I have searched and tried everything that I have seen and have had no luck. Here is the aspx page script and the code behind which fires but does not render the page.
function OpenAssignDialog(sID) {
var dialogOptions = {
url: "../jo_dreamsheet/add.aspx?sID=" + sID,
autoSize: true,
allowMaximize: false,
dialogReturnValueCallback: onCloseCallback
};
var did = SP.UI.ModalDialog.showModalDialog(dialogOptions)
}
function onCloseCallback(dialogResult, returnValue) {
window.top.location = "../jo_dreamsheet/dreamsheet.aspx";
}
This is the code behind that everyone seems to say should work.
protected void btn_click(object sender, EventArgs e)
{
string bin = bin_label.Text;
ClientScript.RegisterStartupScript(this.GetType(), "", "SP.UI.ModalDialog.showModalDialog({ url: '../jo_dreamsheet/add.aspx?sID=" + bin + "'}); return false;", true);
In desperate need of help. Please be specific as possible, seems most answers I can find seem to assume information that is not available.