Here is Sample Code for MainSubmit()
private void MainSubmit(SubmitEventArgs e)
{
bool bSuccessful = false;
try
{
FileSubmitConnection fc = (FileSubmitConnection)this.DataConnections["MainSubmit"];
Uri url = new Uri(ConfigurationManager.AppSettings["Submit"].ToString());
fc.FolderUrl = url.AbsoluteUri;
fc.Execute();
bSuccessful = true;
}
catch
{
System.Diagnostics.EventLog.WriteEntry("MainSubmit", "MainSubmit: Failed to Submit();");
}
// If the submit operation is successful, set
// e.CancelableArgs.Cancel = false;
e.CancelableArgs.Cancel = !bSuccessful;
}
Note:
a. Add the using System.Configuration Name Space to your solution so that you can read the webconfig.
b. Add fallowing key under
<add key="Submit" value="http://<url>/<LibraryName>/" />
No comments:
Post a Comment