.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Attach File causing JavaScript error on Custom Form

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :SharePoint
Let me first apologize for this fairly large post. I've basically laid out the problem I'm having and then how I solved it initially then what the final problem.  The reason I put all of the steps is because I am open to any suggestions about handling this different.  If you want to skip to the actual problem, scroll down until you see the text "-----Go here if you want to see the actual problem-----"

Okay, so now the problem:
I have a lookup field called Room Name in a calendar that is looking data up from a list of rooms.  I have programmatically set the permissions of the room name list items to only allow members of different groups to see certain items.

When people go to the calendar and create a new event, they can only choose rooms that I set their group as having permission to choose.  This works great, but it has an unfortunate side effect.  When viewing an event on the calendar, if you are not of a memeber of the group that has read permissions for the item selected in Room Name, you can't see it.  This makes sense internally because of the way I set permissions.  For each item in the list of rooms, if you are a member of a group that should be able to read that item, I give you read permission, otherwise you have no permission for it.

Unfortunately, the viewing of the events is done by people other than those who create the

View Complete Post

More Related Resource Links

How to include a javascript file in a custom action?

I need to call a custom javascript function from a ribbon button, how do I include the javascript file within the custom action solution in order that it will be properly referenced by the html output? I am not allowed to define a custom masterpage at this point. So what can I do?   Thanks, Stephan  

Attach File to Custom List

Hello - I need to use the Client Object Model to attach an item to a custom list item.  I have attachments enabled on the custom list.  The following code will upload a attachment to a list item ONLY if at least one attachment was added to the item via SharePoint. Dim credentials As New System.Net.NetworkCredential(MyUser, MyPassword, MyDomain) Dim SiteUrl As String = "http://spsandbox13" Dim clientContext As New ClientContext(SiteUrl) clientContext.Credentials = credentials '-- List item 41 hard coded for testing Dim attachmentPath As String = String.Format("/{0}/Lists/{1}/Attachments/{2}/{3}", "sites/ITS/GBPlayground", "FormConfiguration", "41", "SomeFileNameForMe7") Using fs As New FileStream("C:\Users\gbadmin\Documents\WhatsUp.txt", FileMode.Open) Microsoft.SharePoint.Client.File.SaveBinaryDirect(clientContext, attachmentPath, fs, True) End Using The above code works great as long as the item already has an attachment.  If the item doesn't have an attachment I get a (409): Conflict error.  I've also tried to create a folder in the attachments folder for the list item to see if once the folder was created that the error would go away.  The code for this is as follows: Dim list As Microsoft.SharePoint.Client.List = clientContext.Web.Lists.GetByTitle("

Validation is not working in Custom List Form using JavaScript ddwrt:GenFireServerEvent()

Hii am creating custom New form for a list using sharepoint designer. i have added the below button for sumbit<input name="Submit1" type="submit" value="Submit" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={http://myserver/Lists/VTest/AllItems.aspx}')}" />                <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;                                    </xsl:text><input name="Submit2" type="submit" value="Cancel" onclick="javascript: {ddwrt:GenFireServerEvent('__redirect={http://myserver/Lists/VTest/AllItems.aspx}')}" />the problem is the validation is not working properly. it submits the page without entering values for the required fields.particularly the validation is not working for DateFields.let me know what is the problem here. is it a Bug?muthu

There has been an error while loading the form - The following file is not a valid InfoPath form tem



We’re experiencing quite an odd issue with opening forms within a SharePoint form library. These are the symptoms;

We recently published a newer version of an InfoPath form, and have since received some feedback that the form no longer opens in the “View Properties” view of SharePoint.

Rather interesting though, within the standard view all form instances can be opened with no problem.

The reason this has to work within the “View Properties” view of SharePoint is because we have a workflow that is sent, with a link to this particular page.

This is the error message that is displayed;


There has been an error while

can not attach custom aspx list item form to the list




I'm need make custom aspx list item form for tasks of my workflow. I'm use code from this book: SharePoint 2010 as a Development Platform


my Elements.xml file

<?xml version="1.0" encoding="utf-8"?>

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

  <ContentType ID="0x010801005c12bbf6e6e548569e8100f1ad953859"

               Name="?????? ???????? ???????? ?????????? ???????????"

               Group="Custom Content Types"

               Description="My Content Type"



InfoPath error: One or more required custom controls in this form cannot be created


I have an InfoPath 2007 form published to a form library in MOSS 2007.  This form opens in InfoPath and is not browser-enabled.

The form suddenly stopped working for me and 1 other user.  I'm a farm admin and the user only has contributor rights on the form library (and site and subsite).  Everyone else with appropriate permissions can access existing forms that use the template and can create new forms using the template.

When either one of us tries to open the form, we get:

InfoPath cannot open the following file: http://site/subsite/formlibrary/filename.xml?OpenIn=PreferClient&NoRedirect=true&XmlLocation=/subsite/formlibrary/filename.xml.
One or more required custom controls in this form cannot be created.

No errors in the web front end event log or SharePoint log files.  No errors in my client PC's event log.

I've tried the following without success:

Opening the template and publishing it to a new list. 
Published the template to a new content type on this list and a new list. 
Dumped IE cache and reset IE settings.
Rebooted the computer.
Checked permissions on the list to make sure they were correct.

Last change made to the farm:

I performed the work around change to the web

error while openning infopath file + "The Form has been closed."



I have restored the "Infopath" library from production to staging server

and when i tried to open the InfoPath form template(i.e TestFile.xsn file), but i am getting below error "The Form has been closed."

Actaully when i saw the log in 12\log folder, the error is given below

"10/07/2010 06:20:59.47  w3wp.exe (0x1A10)                        0x1740 Forms Server                   Forms Services Runtime         8ged Medium   MetaInformationByUrl:CrossSite check failed for site URL=http://mysitestaging/teamsites and file URL=: http://mysite/teamsite/formservertemplates/research%20request.xsn "

Please help me to solve this issue

Infopath 2007 form error - Selected file is too large


We are using Inforpath form to capture some metadata along with couple of file attachments. We implemented that and its working fine

When we tested by trying to upload file more than 5 MB we got the following error

"The selected file is too large and is causing the form to exceed the amount of allowable resources. Select Another File"

During its analysis we found that this can be resolved by changing one of the "Infopath forms service " configuration named "Maximum size of form session state".

Is there any issue (like performance issues) in increasing this limit to allow us to upload the large attachment


In other words

In the Maximum size of form session state text box, type the maximum session state size in kilobytes. Form-filling sessions that exceed this value will terminate, an error message will be generated, and all form data entered during the session will be lost. The default value is 4096 kilobytes.

If I make this value to 10240 kilobytes (10 MB) ; will this cause any performance issues ??

DataBase error - An attempt to attach an auto-named database for file ...


I m trying to save files like pdf, word, excel etc... into sql express, but m getting this error in my web page:

 An attempt to attach an auto-named database for file C:\Users\malek.safa\Documents\test vb\SavingFileInDB\SavingFileInDB\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.


 m not getting errors inside my code, just this one appearing on the web page. any idea? thanks

Embedded Javascript File in Custom Server Control



I am creating a custom server control, and I am wanting to include a JavaScript file in the dll file when the control is built. I have tried suggestions from the following websites:




But after following the directions, If I use firebug to see what errors show up, the JavaScript functions that are being called all say "goNext is not defined" which leads me to believe the JavaScript file is not being added correctly. 

Some information on what my control looks like

I have the JavaScript File in a folder called Script. The namespace of the project is CustomControl, and the Name of the project is MaskedDateTextbox.

In my AssemblyInfo I have the following:

http 400 Error when performing item upload after setting custom edit form on content type



What I am trying to do is create custom edit forms for different content types within the same document library.....so basically I have done the following:

  • I have created two site content types and reconfigured my library to use CT's. 
  • I then connected to my site using SPD. 
  • When examining my library I can see that I have the two CT that I added earlier.  I then created a new editform for one the CTs using the top ribbon menu and in the drop down box associated it to the CT.  I did not select this as the default form for the library.
  • I then updated the library CT (not site CT) with the url to form in the editform properties.

When I create a document and edit the properties it works fine - totally as expected.  However when I upload a document the default EditForm for the library is used and I can select the CT to associate the document to.  When I choose the CT with the custom form the new edit form is not found and I get a page not found error - http 400.

The full url for this library is is http://XXXX/functions/ehs/CSI

So the URL I have used is /functions/ehs/CSI/Forms/EditForm2.aspx (EditForm2.aspx) is my form and this is fine.  I have even used CSI/Forms/EditForm2.aspx and this works...  BUT ne

how to specify file name and close the info path form on custom submit button?

i have submit button in the form once i click it must ask to enter the file name and once i given it it must close the particular browser tab.

Custom File Stream Result error when the client connection is closed


I recently notice that on our MVC 2.0 web app that does images retrieval,  we have this error when the user close the browser before image file is done transmitting :

TypeName: System.Web.HttpException

TypeAssembly: System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Message: The remote host closed the connection. The error code is 0x80070057.

Source: System.Web

TargetSite: Void RaiseCommunicationError(Int32, Boolean)

StackTrace:    at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)

   at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()

   at System.Web.HttpResponse.Flush(Boolean finalFlush)

   at System.Web.HttpResponse.End()

   at CT.iMagio2.Apps.Web.Search.Controllers.ControllerActionResultInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)

   at System.Web.Mvc.ControllerActionInvoker

how to specify file name and close the info path form on custom submit button?

i have submit button in the form once i click it must ask to enter the file name and once i given it it must close the particular browser tab.

Backup/Restore 404 File not found error ;Site site created besed on Custom Site Template




I am using SharePoint (Version: 12.0.6318.5000). The scenario is like that;

  • I have created a Site Collection and under that I have 2 sub sites and under each sub sites again I have a sub site (Site Collection [level 1]>>>SubSite+Lists [level 2]>>>SubSite+ Lists [level 3]>>>Lists, Doc. Library and Picture Library

Custom Workflow deployed:Feature activation error:The file or folder name contains characters that a



I am migrating custom workflow which was running in moss 2007 to SharePoint 2010.The approach was i created a new Sequential workflow project in VS 2010 under sharepoint . then i copied my Workflow files.Removed old refernces to 12 hive and updated to 14 root.

I could successfully buid this project.Then i have added Module project item called 'Forms' where i placed my Intiation form which is a infopath published form to nework location.

I could package and deploy the solution.But facing an error while Activating the feature.the error is The file or folder name contains characters that are not permitted.  Please use a different name.


Any help will be highly appritiated



Ram kiran


InfoPath form submission error: You do not have permission to create a file in this location.


I have created an InfoPath 2007 form and published it to a SharePoint 2007 site. We use active directory authentication. The library has contribute rights for all authenticated users. The site itself has restricted read for all authenticated users (so they don't see the site actions button). An employee can open the form (locally in InfoPath), but when they click submit the authentication window pops up. Putting in credentials does nothing. Clicking cancel gives this error:


InfoPath cannot submit the form.
Some rules were not applied.
An error occurred while the form was being submitted.
The form cannot be submitted to the following location: ....... (path to library)
You do not have permission to create a file in this location.

Does anyone have a solution to this issue?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend