Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i developed web part in C#,i added this web part into share point download link was working in development system but it not working in production server .
below one is error.

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12031
Line: 5
Char: 62099
Code: 0

page load:
lnkBtnResumeDownload.OnClientClick = "DownloadFunction()";
this.btnDelete.Attributes.Add("OnClick", "return confirm('Are you sure you want to delete the selected Engagement ?');");

link button click:
try
{
if (id > 0)
{
string strSql = string.Empty;
strSql = string.Format("SELECT Attachment, FileExtn FROM Engagements WHERE EngID = {0}", id);

DataSet ds = new DataSet();

ds = SQLHelper.ExecuteDataset(CONN_STRING, CommandType.Text, strSql);

if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
{
DataRow dr = ds.Tables[0].Rows[0];
if (!DBNull.Value.Equals(dr["Attachment"]) && !DBNull.Value.Equals(dr["FileExtn"]))
{
byte[] fileData = (byte[])dr["Attachment"];
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment; filename=" + "temp." + dr["FileExtn"].ToString());
BinaryWriter bw = new BinaryWriter(Response.OutputStream);
bw.Write(fileData);
bw.Close();
Response.ContentType = ReturnExtension(dr["FileExtn"].ToString());
Response.Flush();
Response.Close();
}
}
}
}
catch (Exception ex)
{
ErrorHandling.ErrorLog("Page : ManageEngagements.ascx.cs ; Method : DownloadAttachment ; Error : " + ex.Message);
lblDisplay.Text = "Error in loading data. ";
}

java script function:---
<script language="javascript" type="text/javascript">
function DownloadFunction() {
window.WebForm_OnSubmit = function()
{ return true; };
}

Thanks,
Madhu.
Posted
Updated 17-Jan-12 19:12pm
v2

1 solution

If this is truly the place where the exception is being generated then it would seem to indicate the problem is with your ErrorHandling.ErrorLog code.

Are you using an external database? You are not directly querying the SharePoint database are you?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900