Is It Possoble To Run 'Generate Local Resources Tool' Programmatically
Jan 22, 2011Is it possible to run Visual Studio tool: 'Generate Local Resources' programmatically?
View 1 RepliesIs it possible to run Visual Studio tool: 'Generate Local Resources' programmatically?
View 1 RepliesI've build an simple control called Menu:
namespace MyControls
{
public class MenuItem
{
public MenuItem()
{
Visible = true;
}
[Localizable(true)]
public string Text { get; set; }
[Localizable(false)]
public string Link { get; set; }
[DefaultValue(true)]
public bool Visible { get; set; }
[Code].....
Users want to get email PDF report. I am using ASP.net Reportviewer .rdlc file in local mode (I don't have a sql reporting services). My question is how to generate PDF reports programmatically without going to the report web page.
View 2 RepliesI have used Global Resources in asp.net MVC, but how do I use Local Resources in asp.net MVC?
View 1 RepliesIt seems that using Local resources is much more complicated when using Razor. I recently converted an MVC 2 app I was working on to MVC 3. The conversion went well but accessing LocalResources doesn't work and I can't get it to work. In MVC 2 I created an App_LocalResources folder in the /Views/Home folder and created an Index.aspx.resx resource file. In the Index View I could access the local resources with
<%: GetLocalResourceObject("FirstName") %>
Simple, out-of-the-box functionality, as it should be. Razor doesn't understand this. It seems that in Razor you have to use @HttpContext.GetLocalResourceObject(<virtual-path>, <resource-name-key>). I've tried everything for virtual-path but nothing seems to work ("~/", "~/Views/Home/App_LocalResources", etc.). I tried to directly access the resource file by providing the complete namespace, like you do with global resources (which works fine in Razor), but then it errors stating that the culture is required. Intellisense allows you to build the reference to the resource property but Razor doesn't understand it.
Of course an alternative could be to simply use the ASPX rendering engine in MVC 3, but I want to use Razor. Does anyone know an out-of-the-box method (not some exotic work-around) for accessing the LocalResources in an MVC 3 app using Razor?
I have an ASP.NET web application that runs on a windows server 2003 server. there is a form that reads and writes data to an xml file inside the application's directory.
I always grant the NETWORK SERVICE user full control on my application folder so that it can read and write to the xml file. I put the application on another windows server 2003 server and did the same steps above but i was getting an Access denied exception on the form that reads and writes to the xml.
I did some search and found that if you grant the user ASPNET full control to the directory it would work, I did that and it worked fine. my question is: what is the difference between granting full control permissions to NETWORK SERVICE and ASPNET users ? and what can be the difference between the two servers that caused this issue ?
I'm writing a sample project that supports multilanguage. I'm using Resource files for that. I want to use Local Resources.
Here is what I've done.
1. Add 'App_LocalResources' folder in View/Home/ directory.
2. Add 'Index.resx' for the default language and 'Index.en.resx' for my other language.
3. I've made the Access Modifier as 'Public' and Custom Tool from properties to 'PublicResXFileCodeGenerator' and gave identical Custom Tool Namespace to both of that files ('Example')
4. I put an example 'Title' string in both my resource files and accessed it from my 'Index.cshtml' view in Views/Home directory like this:
[Code]....
When I run the application the default language Title from the Index.resx displays like charm, but when I change the language it can't seem to find the other file 'Index.en.resx' and the Title doesn't change.
For the record I tried the same thing with Global Resources, i.e. Create 2 global resource files and get the title of my Index page from them and it's working, i.e. the language changes when I change the cultures.
I'm using Visual Studio 2010 Premium, version 10.0.30319.1 RTMRel, .Net Framework v 4.0.30319 RTMRel and MVC 3
My application creates some images at client machine using client side scripting VBScript. I want to store those images in database, so I need some way to bring those images to server without any interaction with users (means I can not use the file upload control).Along with this, application would also like to use the printer attached to client's machine (it could be her network printer), without showing printer dialog.
Basically I need to create some client piece, dll which will handle the scanning, printing and uploading images from client pc to server and web application will interact with this dll.How could I achieve this? I explored a lot on internet. many articles suggest that use activex control, but how in c#?
I am not asking any spoonfeeding. Please show me correct article or small working sample or example, I would figure out the rest.
when generating local resources by using ( "Tools"->"Generate Local Resource" ) i noticed that some controls disappear in run time.
is good to take advantage of Visual Studio to automatically generate it? or is better to create resource files and add meta:resourcekey="..." to my page manually??
I am working on website development in asp.net. where i have used Master Page concept and content page. and by using dropdownlist I am changing its language.
View 1 Repliesi want to generate code for .net n-tier application.or 3-tier application.so which tool is more useful.
View 3 Repliesi am developing an web application using vs 2008..( i am new to vs 2008)
Is there any .net tool to generate data access layer or common classes ?
Is There Any Way or trick to generate local resource for all pages in visual studio 2010 automatically? I have about 500 pages and UserControls. its hard to generate resource for every page one by one.
View 1 RepliesI have an existing dataset in VS2008 and app works fine untill I tried to add new datatable.It gave me the following error -
Custom tool error: Failed to generate code. Unable to convert input xml file content to a DataSet. Invalid XPath selection inside field node.
And designer.cs got deleted.If I mannually add datatable in .xsd then it is good.But that option is not acceptable.
we have an existing ASP.net application that is undergoing expansion. The new functionality is all written in Silverlight 4. As part of that expansion I gutted all the old Linq to SQL and put Entity Framework 4 into place. To do this I created a standard .net Class Library and added my edmx files there. Naturally, the business entities created by this cannot be used in Silverlight. So I created a Silverlight Class Library and added all the business entities to that Silverlight Class Library as linked files. I changed the name space to be the same.
So I have the following assembly / namespaces
Company.Project.Dal.csproj / Company.Project.Entities (.net 4 class library)
Company.Project.Entities.csproj / Company.Project.Entities (SL4 class library)
With this architecture I was able to share my business entities with my SL enabled web services, my asp.net projects, my silverlight projects. Really it's a beautiful thing.
Once this was done I added "message" classes to Company.Project.Dal and again shared them with the other entites using linked files. These messages are things like MyObjectRequest; they are classes that have properties that can set to the ID of the record in the database you want to get, a search string for filtering by last name, first name, etc. (This is in the style of the Web Service Factory if you're familiar with that.)
Finally I turned the whole message into a generic using a base class called EntityRequest
[code]...
I corrected this error and everything went well for a week until I had to make my first change to the service interface. I added a new operation contract, clicked the handy Update Service Reference on my client and boom.
I am using VS.Net to do a localiztion project, it allows me to create a resource file by going to Tools->Generate Local Resource. However the resouce file generated is not complete in my opinion. Say the following html:
[Code]....
the wizard creates an entry for "Last Name", but not "First Name", is this by design? If yes, how do I work around that?
I have this message when I want to use Local Resources with my web application.
View 2 RepliesWhy when I generate local resource does it check out the web.config. I've done a comparison after the process has completed and the web.config hasnt changed.I'm using TFS 2010 Basic.It's not a big issue but I would be interested if anyone knows the answer.
View 1 RepliesI'm a newbie to ASP.NET and I have a following queston.
There is a HTML template in my project with some LI elements to create a multiple checkboxes on my page. Template looks like this:
[Code]....
These LI elements must be generated with standard asp:CheckBox in it for every value, retreaved via webservice request.
I m trying to read the tags of a local HTML file. I found out this code online but it works for the aspx pages on the server and of the current app only.
___________________________________________________
using System.Web.UI.HtmlControls;
foreach (Control c in this.Page.Header.Controls)
{
if (c.GetType() == typeof(HtmlMeta))[code]...
THis code acceses the following section of an html page -
<meta name="Keywords"content=" B=Msdn;A=Forums;L=en-US;"
/>
My question is how can i do the same for a local(client) html page?
Can i do it for a html page on server?
i have an asp.net project in vs2010 i have a db and table inside the app_data folder, i have created a deployment package and have imported the package into an iis server that is installed on my local mechine.
now i get this error message while trying to preform an insertion.
Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed
the connection string is:
Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|survey.mdf;Integrated Security=True;User Instance=True
when running it inside VS2010 it`s working fine.
I have recently upgraded to VS 2010 and converted my web site into a web application. Now, when I attempt to build, I receive the error:
Resource name '<name>.Resources.resources' cannot be used more than once.
There is no page name or anything, and I have completely exhausted all that Google has to offer.
When I run the application using the Web Developer it works fine. However when I run it using local IIS I get the following error:
The resource class for this page was not found. check if the resource file exists and try again. Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The resource class for this page was not found. heck if the resource file exists and try again.
Source Error:
Line 81: private void PopulateLanguageList()
Line 82: {
Line 83: DropDownListLanguage.Items[0].Text = (string)HttpContext.GetLocalResourceObject(
Line 84: "Default.aspx", SelectLanguage, Thread.CurrentThread.CurrentCulture);
Line 85: }
Stack Trace:
[InvalidOperationException: The resource class for this page was not found. Please check if the resource file exists and try again.]
System.Web.Compilation.LocalResXResourceProvider.CreateResourceManager() +4038050
System.Web.Compilation.BaseResXResourceProvider.EnsureResourceManager() +23
System.Web.Compilation.BaseResXResourceProvider.GetObject(String resourceKey, CultureInfo culture) +24
System.Web.Compilation.ResourceExpressionBuilder.GetResourceObject(IResourceProvider resourceProvider, String resourceKey, CultureInfo culture, Type objType, String propName) +32
System.Web.HttpContext.GetLocalResourceObject(String virtualPath, String resourceKey, CultureInfo culture) +56
APPortal.Login.PopulateLanguageList() in c:inetpubwwwrootAPPortalDefault.aspx.cs:83
APPortal.Login.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootAPPortalDefault.aspx.cs:20
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
System.Web.UI.Control.OnLoad(EventArgs e) +132
System.Web.UI.Control.LoadRecursive() +66
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428
I created a website using VS2010. When I run the website using built-in web server, everything works fine. The website recognizes javascript and aurigma uploader. When I publish the website to local folder and tried to access using IIS 5.1 on local pc,
the java scipt files did not work. I was getting yellow triangle sign at the bottom of the page indicating the object is expected. I tried to look online but i could not find any answer. I have included jquery and javascript file in the header section of master
There is a hyperlink to a local file...for instance....C:/text.txt. This is not possible, because ASP.net does not allow links to local files. But, links to files on network drives such as W:/test.txt are working ok. how does the browser know which drive letter is local,and which is networked? How does it know that C: is local or D: is local etc, and that W: is a network drive?
View 1 Replies