AppGlobalResource File In Visual Webpart SharePoint 2013

Hi,
I am trying to get resource file entry in the visual web part but wen i try to deploy the solution it's showing an error as below.
Error    14    The name 'MyResourceFile' does not exist in the current context    C:\Users\Administrator\Documents\Visual Studio 2012\Projects\MySolution\MySolution\WebParts\Test\Test.ascx.g.cs    56  
 60    MySolution
What i did:
I right click on my project name and choose "Add" >> "New Item"
In the next dialog select the "Empty Element" and name it e.g. "GlobalResources"
Now click right on the new "GlobalResources" folder (Module) and add a new resource file.
I named it MyResourceFile.resx
Enter some keys and values in the resource file
In the next step click on the MyResourceFile.resx file to display the properties. Change the "Deployment Type" attribute to "AppGlobalResource".
Now i created a asp literal control and in the text property i did the following
<asp:Literal ID="litControl" runat="server" Text="<%$ Resources:MyResourceFile, Name %>"></asp:Literal>
and then i tried to deplo the solution i get the following error
Error    14    The name 'MyResourceFile' does not exist in the current context    C:\Users\Administrator\Documents\Visual Studio 2012\Projects\MySolution\MySolution\WebParts\Test\Test.ascx.g.cs    56  
 60    MySolution
Please let me know what am i missing,actually i want to deploy my resource files under the AppGlobalResource folder.

I am trying to get value from the resource file but not able to deploy my solution.
I  added an empty element in my solution and then added resource file in it,after that i used to get resource file value in the mark up file like this
<asp:Literal ID="litControl" runat="server" Text="<%$ Resources:MyResourceFile, Name %>"></asp:Literal>
but when i build/deploy the solution i am getting the following error.
The name 'MyResourceFile' does not exist in the current context.
Note: I am using SharePoint 2013 and using Visual Studio 2012 Premium edition,and this issue is occuring in both sandboxed and farm solution.
please help.

Similar Messages

  • Error In Visual WebPart SharePoint 2013

    So I was creating a SharePoint 2013 visual web part on Visual Studio 2012 and came to this problem. Visual Studio automatically creates WebPartUserControl.ascx.cs and WebPartUserControl.ascx.g.cs. the WebPartUserControl.ascx.g.cs is generated automatically
    when you edit the WebPartUserControl.ascx file. So I've added a couple of ContentTemplate tags into .ascx file and Visual Studio generated this code in WebPartUserControl.ascx.g.cs :
    public partial class WebPartUserControl {
       public static implicit operator global::System.Web.UI.TemplateControl(AjaxVisualWebPart target)
           return target == null ? null : target.TemplateControl;
    When I try to deploy the solution, Visual Studio underlines the implicit operator
     global::System.Web.UI.TemplateControl and
    I get this error:
    Namespace.WebPart.WebPartUserControl.implicit operator
    System.Web.UI.TemplateControl(Namespace.WebPart.WebPartUserControl)':
    user-defined conversions to or from a base class are not allowed
    I don't even imagine how to solve this even though im struggling on this issue for a couple of hours now... Can somebody help me, please? I assume I have to add something to the .ascx file or to WebPartUserControl.ascx.cs maybe? Thanks in advance!

    Hi somu1,
    I suggest you check if the parameter is valid in the function.
    By default, the parameter is the same as you class name like below:
    public partial class HelloWorldWebPart {
    public static implicit operator global::System.Web.UI.TemplateControl(HelloWorldWebPart target)
    return target == null ? null : target.TemplateControl;
    Here is a detailed code demo for your reference:
    A look at Visual Web Parts in Visual Studio 11
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Zhengyu Guo
    TechNet Community Support

  • Captcha in Visual Webpart SharePoint 2013

    I want to insert a captcha control like below in my visual web part in sharepoint 2013.
    Please suggest how can i achieve this.

    Hello,
    Hope the below link helps you
    http://recaptchaforsp.codeplex.com/
    http://www.etechplanet.com/blog/create-captcha-image-using-c-and-aspnet.aspx
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • How to enable visio file (.vsd) preview in sharepoint 2013

    I enabled visio service, but when I click a vsd file in document, it is not show online, just download it.
    Awen

    As per my understanding SharePoint will not open .VSD files in browser. If you are using Visio 2013 then save those files as .VSDX and SharePoint 2013 will open those files in Browser or you can save your Visio file as Web Drawing (.VDW) and they should
    open in browser as well.
    Amit

  • To show ECB in dataview webpart Sharepoint 2013

    HI
    I have to add ECB to my dataview webpart. Normally it was not feasible in 2010 but is it possible now in 2013.
    Can we add the ECB or it remains same 
    Thanks

    Hi,
    According to your post, my understanding is that you wanted to show ECB in dataview webpart Sharepoint 2013.
    If you want to enable ECB menu on a column in dataview webpart, you need to open the SharePoint Designer 2013, select the web part, under
    <View> locate  <ViewFields> and then the
    <FieldRef Name=”Title”> or the field where you want to enable the ECB menu and then add the attribute
    ListItemMenu=”TRUE”.
    Here is a similar blog for you to take a look at:
    http://www.dhirendrayadav.com/2013/12/enabling-ecb-menu-on-custom-column-in.html
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to change 'Modified By' column value when a new file is uploaded in SharePoint 2013 using Client Object Model?

    I want to change 'Modified By' column value of a file that is being uploaded using Client Object Model in SharePoint 2013. The problem is that the version of the file is changing. Kindly help me. The code that I am using is:
    using (System.IO.Stream fileStream = System.IO.File.OpenRead(m_strFilePath))
        Microsoft.SharePoint.Client.File.SaveBinaryDirect(m_clientContext, str_URLOfFile, fileStream, true);
        Microsoft.SharePoint.Client.File fileUploaded = m_List.RootFolder.Files.GetByUrl(str_URLOfFile);
        m_clientContext.Load(fileUploaded);
        m_clientContext.ExecuteQuery();
        User user1 = m_Web.EnsureUser("User1");
        User user2 = m_Web.EnsureUser("User2");
        ListItem item = fileUploaded.ListItemAllFields;
        fileUploaded.CheckOut();
        item["UserDefinedColumn"] = "UserDefinedValue1";
        item["Title"] = "UserDefinedValue2";
        item["Editor"] = user1;
        item["Author"] = user2;
        item.Update();
        fileUploaded.CheckIn(string.Empty, CheckinType.OverwriteCheckIn);
        m_clientContext.ExecuteQuery();

    Hi talib2608,
    Chris is correct for this issue, when calling update using ListItem.update method, it will increase item versions, using SystemUpdate and UpdateOverwriteVersion will update the list item overwrite version.
    these two methods are not available in CSOM/REST, only server object model is available for this.
    Thanks,
    Qiao Wei
    TechNet Community Support

  • Resource Files in SandBoxed Solutions SharePoint 2013

    Hi,
    I want to create Resource files MyResource_en.resx and MyResource_ar.resx in the sandboxed solutions,how can i do that because as per my understandings we cannot access resource files from the App_GlobalResources folder in our virtual directory when working
    on sand boxed solutions.
    Can anyone suggest me the work around to use resource files in sand boxed solutions.

    Hi,
    According to your post, my understanding is that you wanted to create Resource files in the sandboxed solutions.
    There is an article for your reference, although it is about the SharePoint 2010, it is similar to SharePoint 2013.
    Embedding Resources in Sandbox Solutions
    Per my knowledage, SharePoint sandboxed solutions are deprecated in SharePoint 2013 Preview in favor of developing apps for SharePoint. 
    I recommend to create App to achive what you want.
    More information:
    SharePoint 2013: Sandboxed Solutions are deprecated
    SharePoint 2013: What to Do? Farm Solution vs Sandbox vs App
    Build apps for SharePoint
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • One or more required office component failed to complete successfully for more information, consult the setup log file. while uninstallation of sharepoint 2013

    One or more required office component failed to complete successfully for more information, consult the setup log file. while uninstallation of sharepoint 2013

    go to start > run > type %temp% > here check for latest file and provide us details in that log file
    If this helped you resolve your issue, please mark it Answered

  • Issue with large file uploads 2MB to SharePoint 2013 using CSOM in BizTalk 2013

    Hi,
    I am getting errors when I try to upload any file > 2MB to any SP site using BT 2013 CSOM .
    Any file less than this processes successfully.
    Any one having experience in correcting the issue ?
    Thanks
    Ritu Raj
    Regards
    Ritu Raj
    When you see answers and helpful posts,
    please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

    Did you try asking in a SharePoint forum?
    Thanks!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Unable to open .htm file in browser using SharePoint 2013 ?

    On Share Point 2013 we had .htm file which was published under excel as shown below (File name t1.htm)
    As the Icon is different from normal excel file.
    My question is why the .htm file is opening in Excel when we access from SharePoint Web Interface ?
    And when we use the option "Open in Explorer" it opens the .htm file in browser.
    I need the publish .htm file needs to be open in Browser.
    Thanks for reply.

    Looking at this a little more closely, what happens is when you upload the Excel HTM file, a folder is also uploaded to the Library (but hidden outside of the WebDAV view). This folder would be named "t1_files" in your case. If this folder is present (which
    it needs to be as t1.htm references files within it, including all of the sheets), then it will attempt to open with the client application because of the association within C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\XML\DOCICON.xml,
    referring to the line:
    <Mapping Key="Excel.Sheet" Value="ichtmxls.gif" EditText="Microsoft Excel" OpenControl="SharePoint.OpenDocuments" OpenApp="ms-excel" />
    Removing this line will cause it to be treated as a standard HTM file, but I'm not sure how that will work out for your scenario.
    The other option is to install and configure Office Web Apps 2013 on a separate server so you can display Office documents in the browser.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Unable to open files from web on Sharepoint 2013

    I have a user who is having an issue opening any files on sharepoint site. I have checked technet for possible solutions and this is what has been done so far:
    Environment: VDI using Xendesktop with Windows 7 Enterprise, Office 2013. 
    1. Ran repair on Office 2013 professional plus (32-bit)
    2. Uninstalled and re-installed office.
    3. Cleared the cache from Skydrive/ Office document upload center.
    4. Tried to reproduce issue on another thin client with a different user logging in and accessing the same file...no issue. 
    User can download the file and upload the file with no issue just cannot open it online in webapps using IE9. 
    The OS is a 64-bit Windows 7 Enterprise and he has used IE9 32 bit and 64 bit with same issue. 
    Permissions were verified to the file as well. 

    what error user getting? did you try to different user on the same machine or same user on different machine?
    did you see any error in ULS logs?
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Error while opening .PDF files in document library sharepoint 2013

    Hi
    I am getting an error while opening a .pdf file,
    Please help me find the solution.
    Thanks
    Paru

    Launch IE -> Click on Gear (settings) -> Manage Add-ons -> Show: All Add-ons ->
    There are 2 Adobe Add-ons:
    Adobe PDF Reader  &  Adobe Acrobat Sharepoint Open Document
    Double-click both and be sure to click the button "ALLOW ON ALL SITES"
    (An * will appear in the field)
     http://crowdsupport.telstra.com.au/t5/T-Suite-Applications/There-was-an-error-opening-this-document-The-filename-directory/td-p/197425
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/ae2eea40-9fa6-46be-bca1-ac5eb5597d5e/sharepoint-2010-adobe-reader-error-opening-pdf-files?forum=sharepointgeneralprevious
    http://community.office365.com/en-us/f/154/t/46204.aspx?PageIndex=2
    disable the Mcafee Firewall Plug In.  This is after of course I ran superantispyware to remove some malware.  uninstalled and reinstalled the Adobe Reade
    https://forums.adobe.com/message/1776202?tstart=0

  • Using CreatedModifiedInfo in custom webpart SharePoint 2013

    We've used those lines of code in SharePoint 2010 for a long time and we never had any issues with them. We've created a custom webpart and added the modifiedinfo toolbar to the bottom. Now we've moved our site from SP2010 to a SP2013 while still using SP2010
    UI. So we're still in 2010 mode while this problem occurs.
    internal static void AddToolBarInfo(this ToolBar toolBar, SPControlMode mode)
    info = new CreatedModifiedInfo();
    info.ControlMode = mode;
    toolBar.Buttons.Controls.Add(info);
    The control is added properly but no information are shown inside the toolbar. Somehow not many persons have used this toolbar, so I'm not able to find many informations about it. Since we've never done more than adding the control, I don't know where to
    start looking when the control is not properly filled.
    Regards Andreas MCPD SharePoint 2010. Please remember to mark your question as "answered"/"Vote helpful" if this solves/helps your problem.

    Has anyone used the CreatedModifiedInfo before in his code?
    Regards Andreas MCPD SharePoint 2010. Please remember to mark your question as "answered"/"Vote helpful" if this solves/helps your problem.

  • How to manage huge file size documents in SharePoint 2013?

    we have different kinds of files
    .avi, .wmv, mpeg, .mpg, .m1v, .mp2, .wav, .snd, .au,.mdb,
    .db,.bat, .exe, .dll,
    and .jar
    huge in file size.
    appreciated solutions for DMS. like sharepoint and file server or any other solutions.

    You have a hard limit of 2Gb which you cannot get around with Remote Blob Storage or anything else. Beyond that size, you're going to have to store content outside SharePoint with links to the content for your readers, of using Search Indexing on the file
    location.
    If the files are large but not greater than 2Gb they can be stored in SharePoint, but you should be aware of the supported limits for Content Database size, which I recall as 100Gb for a single Content DB, or up to 200Gb for a rarely updated Content DB containing
    a single site collection.
    w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP

  • Backup Solution File using PowerShell using sharepoint 2013

    please let me know why this error is occuring.
    $farm = Get-SPFarm
    $file = $farm.Solutions.Item("GIB_Extenstion.wsp").SolutionFile
    $file.SaveAs("\\sadr01a14101\backup\ GIB_Extenstion.wsp")
    I am running above one by one command on Powershell. In first two commands there is not error only normal.
    but on third command below error is showing:

    Hi John,
    Continue to Wendy, make sure you would be a member of Farm Administrators group and have permission to the configuration
    database.
    Vivek Jagga - MCTS SharePoint 2010
    My Blog

Maybe you are looking for

  • Problem with battery for MacBook Pro 2007

    I have a problem with battery that was replaced during video card service 1.5 years ago Battery health was around 80% and it stopped to work, I continued to use notebook with power cable and after week the battery become like this! spoke with person

  • SQL Developer and Oracle Database 10g Express Edition, Connection Problem

    I am using SQL Developer version 1.2.1 and am connecting to a 10g database on a windows xp. Up until today there have been no problems with the connection. When I tried to connect to the database and have not been able to. The error states that "...l

  • Searching Sequence  query in other query

    Hi With code below when in table TMP_EQUIP_CRM have QTD =2 It return me 2 rows, when QTD = 3 return me 3 rows ....etc SQL> SELECT t2.loc_cntr_id_sn, t2.loc_product_sn,   2         ROW_NUMBER () OVER (PARTITION BY t2.loc_cntr_id_sn, setid, companyid,

  • INterface not viisble in sxi_monitor

    Hello Everyone, I have created a  JDBC to IDOC scenario. .. All the configurations are made and i tested the xi objects  as well.. I could see that in QX1, i have the successful message in SXI_MONITOR . However,. when i try to check the message in QE

  • Premiere Elements 11 is very unstable with my Windows 8 Pro 64bits

    Hi to all, This the first application that is so unstable with my Windows 8 Pro 64bits system. The main trouble is that I didn't manage to see in the main player a single text, photo or movie. I have a dark aera and only if I press the pause button I