getting 404 file not found error while loading visual web part for anonymous user

Posted by Telukuntla under SharePoint on 8/16/2012 | Points: 10 | Views : 1638 | Status : [Member] | Replies : 0
Dear Friends , here I am having problem with visual web part.After deploying into SharePoint it is not accessible for all users.It is accessible for only who created.When I try to log in with another user this webpart is not working .I used RunWithElevatedPrivileges method also,even though it is not working.Please help me to fix this issue.

here is is my code please check it and sort out my issue

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using System.Data;
using Microsoft.SharePoint.Utilities;

namespace BursaryVisualWebpart.BursaryCaseID_DocumentsVisualWebpart
public partial class BursaryCaseID_DocumentsVisualWebpartUserControl : UserControl

protected void Page_Load(object sender, EventArgs e)
using (SPSite site = new SPSite(SPContext.Current.Site.ID))
using (SPWeb web = site.OpenWeb(SPContext.Current.Web.ID))
string bursaryapp = "BURSARY/2012/003";

SPList document = web.Lists["Requirement"];
SPQuery query = new SPQuery();
query.Query = "<Where><Eq><FieldRef Name='ReferenceNumber'/><Value Type='Text'>" + bursaryapp + "</Value></Eq></Where>";
SPListItemCollection objItemcoll = document.GetItems(query);
DataTable itemsDataTable = objItemcoll.GetDataTable();
GridView1.DataSource = itemsDataTable;





(No response found.)

Login to post response