<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<
asp:UpdatePanel ID="upd" runat="server">
<ContentTemplate>
<
telerik:RadGrid ID="RadGrid2" AllowPaging="True"
ShowFooter="true" runat="server" AutoGenerateColumns="False" AllowSorting="True"
PageSize="3" GridLines="None" OnItemCommand="RadGrid2_ItemCommand" CellPadding="0" AllowAutomaticInserts="true"
AllowAutomaticUpdates="true">
<ClientSettings AllowRowsDragDrop="true"></ClientSettings>
<MasterTableView DataKeyNames="Id" AutoGenerateColumns="false" CommandItemDisplay="Top">
<Columns>
<telerik:GridAttachmentColumn DataSourceID="Id"
MaxFileSize="1048576"
EditFormHeaderTextFormat="Upload File:"
HeaderText="Download"
AttachmentDataField="BinaryData"
AttachmentKeyFields="Id"
FileNameTextField="AttachmentFile"
DataTextField="AttachmentFile"
UniqueName="AttachmentFile">
</telerik:GridAttachmentColumn >
 
</Columns>
</MasterTableView>
</telerik:RadGrid>
</ContentTemplate>
</asp:UpdatePanel>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
RadGrid2.DataSource =
TestData.GetEmployeeData();
RadGrid2.DataBind();
}
}
protected void RadGrid2_ItemCommand(object source, GridCommandEventArgs e)
{
//upd.Update();
if (e.CommandName == "DownloadAttachment")
{
LinkButton btn = e.CommandSource as LinkButton;
 
 
string fileName1 = "images\\about.png";
/*
For testing purpose we took only a test image
* you can look at the e.CommandSource to know which row was clicked by
* checking the linkbutton.Text property(LinkButton btn = e.CommandSource as LinkButton;)
*/
FileInfo file = new FileInfo(Server.MapPath(fileName1));
NameValueCollection imageExtensions = new NameValueCollection();
imageExtensions.Add(
".jpg", "image/jpeg");
imageExtensions.Add(
".gif", "image/gif");
imageExtensions.Add(
".png", "image/png");
MemoryStream ms = new MemoryStream();
 
if (imageExtensions.AllKeys.Contains(file.Extension))
{
Response.Clear();
Response.ContentType = imageExtensions.Get(file.Extension);
Response.AppendHeader(
"Content-Disposition", "attachment; filename=" + file.Name);
Response.TransmitFile(file.FullName);
Response.End();
}
}
}
.RadGrid_WebBlue .rgHeader:first-child{ border-left-width: 1px;}border-left-width: 0;if (!objPropertyInsp.hasOwnProperty("sctid")) { contentHTML += "<tr><td>sctid</td><td><input type='text' style='width:100%;' id='txtsctid'" + "' value ='' /><td><div id='dvcombo'></div><img src='Images/find.png' alt='Pick' width='16px' height='16px' onclick='openSearchAttributes(); ' /> </td></td></tr>"; } else if (objPropertyInsp.hasOwnProperty("sctid")) { contentHTML += "<tr><td>sctid</td><td><input type='text' style='width:100%;' id='txtsctid' value ='" + objPropertyInsp["sctid"] + "' /><td><img src='Images/find.png' alt='Pick' width='16px' height='16px' onclick='openSearchAttributes();' /></td></td></tr>"; }I have created one webapplication to insert items in sharepoint site i added sharepoint dll also but wen i debug it showing error that is
Could not load file or assembly 'Microsoft.Sharepoint.Sandbox, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Stack Trace is
[BadImageFormatException: Could not load file or assembly 'Microsoft.Sharepoint.Sandbox, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Sharepoint.Sandbox, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +232
System.Web.Compilation.BuildManager.CompileGlobalAsax() +51
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +337
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Sharepoint.Sandbox, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Sharepoint.Sandbox, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8913739
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259
After i deleted that dll from bin folder and i debug its working but wen i try to insert an item it throwing error
The Web application at http://cisb-orion:8437 could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application
i given platform is x64 and framework is 3.5
please tell me wat is the problem
<telerik:RadGrid runat="server" ID="gv_EmployeesObjectives" Width="100%" Font-Names="Arial" Font-Size="12px" Skin="Office2007" AutoGenerateColumns="false" OnItemCreated="gv_EmployeesObjectives_ItemCreated" OnItemDataBound="gv_EmployeesObjectives_ItemDataBound" > <MasterTableView Name="gv_Objectives" DataKeyNames="ID"> <Columns> <telerik:GridEditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit" HeaderStyle-Width="90px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></telerik:GridEditCommandColumn> <telerik:GridTemplateColumn HeaderStyle-Width="150px"> <HeaderTemplate><asp:Label runat="server" ID="lbl_01" Text="Copy Data from Week"></asp:Label></HeaderTemplate> <ItemTemplate> <telerik:RadComboBox ID="copyDataDDL" runat="server" AutoPostBack="true" Height="100px" OnSelectedIndexChanged="copyDataDDL_SelectdIndexChanged"></telerik:RadComboBox> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn UniqueName="FY" SortExpression="FY" HeaderText="FY" HeaderButtonType="TextButton" DataField="FY"></telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="FiscalWeek" DataField="FiscalWeek" HeaderText="Week"></telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="ObjStopBys" DataField="ObjStopBys" HeaderText="# of Stop Bys" Visible="false"></telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="ObjStopByContacts" DataField="ObjStopByContacts" HeaderText="# of Contacts from Stop Bys" Visible="false"></telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="ObjAppels" DataField="ObjAppels" HeaderText="# of<br />Calls"></telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="ObjContacts" DataField="ObjContacts" HeaderText="# of<br />Contacts"></telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Objr_v" DataField="Objr_v" HeaderText="# of<br />Appts."></telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="ObjPres" DataField="ObjPres" HeaderText="# of<br />Pres."></telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="ObjVentes" DataField="ObjVentes" HeaderText="# of Contracts" Visible="false"></telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="ObjRVSP" DataField="ObjRVSP" HeaderText="ANW"></telerik:GridBoundColumn> <telerik:GridTemplateColumn UniqueName="ProductsList"> <HeaderTemplate></HeaderTemplate> <ItemTemplate> <telerik:RadGrid runat="server" ID="gv_ProductsList" AutoGenerateColumns="false" Skin="Office2007" ShowHeader="false" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" OnNeedDataSource="gv_ProductsList_NeedDataSource" OnItemCommand="gv_ProductsList_ItemCommand" OnItemCreated="gv_ProductsList_ItemCreated" OnInsertCommand="gv_ProductsList_InsertCommand" OnItemDataBound="gv_ProductsList_ItemDataBound" > <MasterTableView Name="gv_Products" CommandItemSettings-ShowRefreshButton="false" CommandItemDisplay="Top" DataKeyNames="ID" EditMode="InPlace"> <Columns> <telerik:GridEditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></telerik:GridEditCommandColumn> <telerik:GridTemplateColumn UniqueName="EmployeesObjectivesID"> <ItemTemplate></ItemTemplate> <EditItemTemplate><asp:HiddenField runat="server" ID="hfEmployeesObjectivesID" Value='<%# Eval("EmployeesObjectivesID") %>' /> <asp:Label runat="server" ID="lblID" text='<%# Eval("ID") %>'></asp:Label> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="ProductID"> <ItemTemplate><asp:Label runat="server" ID="lblProductDescription" Text='<%# Eval("Product") %>'></asp:Label></ItemTemplate> <EditItemTemplate><telerik:RadComboBox runat="server" ID="rcb_Products" DataTextField="Product" DataValueField="ProductID" EmptyMessage="Select" ></telerik:RadComboBox></EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="ObjTotal"> <ItemTemplate><asp:Label runat="server" ID="lblObjTotal" Text='<%# Eval("ObjTotal") %>'></asp:Label></ItemTemplate> <EditItemTemplate><telerik:RadTextBox runat="server" ID="txtObjTotal" Text='<%# Eval("ObjTotal") %>'></telerik:RadTextBox></EditItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> </telerik:RadGrid> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> </telerik:RadGrid>