Hi all,

This is a .NET question that's bugging me.

I'm trying to get a javascript alert to fire before creating a list item
via a button click.

The item is getting created but the alert is not triggering. I know this
should be easily achieved.

Code below.

// Alert user
string PostBackUrl = SPContext.Current.Web.ParentWeb.Url;
string script = "alert('Module has been marked as complete. \n Returning to
course homepage.'); \n";
 script += "window.location.href='" + PostBackUrl + "';";
ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", script,
true);

// Create item
var newItem = list.GetItems(qry).Add();
newItem["Title"] = SPContext.Current.Web.ParentWeb.Title;
newItem["Module"] = SPContext.Current.Web.Title;
newItem.Update();

Regards,

Paul
_______________________________________________
ozmoss mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss

Reply via email to