I'm trying to localize an asp.net web application. Consider the following asp.net code. I'm running with CurrentCulture and CurrentUICulture set to German ("DE-DE").
I expect these two lines to yield the same result, but instead I get this:
Auswertungen für den Tagesabschluss
End of Day
In other words, the first syntax <%= ReportTitles.EndOfDay %>successfully retrieves the value from the ReportTitles.de.resx file we're using, but the second syntax <asp:Literal ID="litLabel" runat="server" Text="<%$ Resources:ReportTitles, EndOfDay %>"/>
gets the value out of the default US English ReportTitles.resx file.
In a view, I want to consume some Json produced by an action on another controller. I don't think I ought to be arbitrarily specifing the url for the resource because if I say something like "/Dealerships/GetDealerData" and if my application is a virtual directory at say "www.somesite.com/MyApplication", then my reference to that resource would break.
I'm sure there's something to do w/ Routes that will allow me to correctly generate the url of the resource by specifing the controller and action name but I don't know what it is and am having difficulty finding it. Can someone please point me in the right direction?
How can I load an embedded resource as an ITemplate? The LoadTemplate() method only takes a string virtual path, and obviously this will not work for embedded resources.
Question: Is it possible to embed .skin files as a resource?
I am creating a library of user controls(grids, buttons, etc.) that are common among all of our web projects. I have included several common javascript files used by the controls by adding them as an embedded resource and registering them as a resource using RegisterClientScriptResource. Everything works great.
However, the last thing I would like to do is embed skin files in this project so that all the controls have the same look. I know I can control look solely with css, but I would like to control some of the other asp attributes as well(ie AllowSorting and AllowPaging attributes of a grid). Is it possible to embed skin files as a resource? Or will each individial project need a copy of the skin file? If anyone could provide insight on how I can go about embedding a skin file..
I have an ASP.NET website and a referenced class library project. In this class library I have a Crystal Report set as embedded resource. I want to load the report dynamically into a CrystalReportViewer.
I have a question about javascript. In my project, there are embedded and non-embedded javascript codes. And i did localization of the embedded codes like below and it works.
I have built a custom control that includes a .js file that needs to be referenced. I set the file to be an Embedded Resource under the Build Action. I then referenced it in the class like this:
I've got a standard ASP.NET control, and I want to insert a C# variable's value into its Text property. HOWEVER, I can't do this via the TextBox's "Text" property (VERY long story) in the C# code; it has to be via the an embedded variable reference in the ASPX file.
Anyway, when I add the following script to my ASPX page at design time:
My objective is to include a JavaScript file in my Custom Server Control, because it's a bit tedious writing all the JS in C#. I've done a lot of searching and most resources seem to say that I need to add the file as an embedded resource, and access that. I found a few pages describing how to do this:
[URL]
They all seem to say I need to, after adding the JS file, change the build action to 'embedded resource' through its properties. However, the only properties I can actually see on the file are 'File Name' and 'File Path'. Right clicking the file in the solution explorer doesn't allow me access to properties, and right clicking (as one of those links suggests) anywhere else doesn't expose it either. I tried looking through VS Options but couldn't find anything, although I get the impression that I have something configured wrong that's not allowing me to see as many properties as I should be able to.
Does precompilation have any effect on XML files? i.e. can I obscure/protect xml files using precompilation? I assume that it has no effect as they aren't code.
If I use XML files as Embedded Resources, they appear in the DLL in a text editor as normal text. If the dll is edited and saved using a text editor, will it still work if it is unsigned?
Firstly, "Modifying" may be the wrong term, I see a few people have posted online just asking whether they can actually modify an embedded resource. What I am wanting to to, is use a resource in my assembly as a kind of template which I would do a find and replace on before registering it on the page - is this possible?
For example; say I have a few lines of jQuery as an embedded resource in my assembly and in this script I am referencing a CSS class name that can be set by the front-end programmer. Since I do not know what the CSS class will be until implementation, is there a way of going through the embedded resource and replacing, say, $myclass$ with ThisClassName.
In our web application we need to keep various company's settings. For eg "DiamondProdRefIDCaption","Shippingpickup","ZipCodeCaption","DefaultCountry","AllowToEditInvoice", etcThese settings are different for various companies and are placed in web.config as key-value pair.Initially, we have tried do simplify this process by adding a company_settings table in the DB so as to allow us to add companies on the fly. However, this method makes it very difficult to add a new setting
i have created a aspx page with the script manager, update panels and so on. Now, when i use some jquery functions which are included inside the head tags, when the page is run, i find the script tags generated inside the body instead of the head tag. i'm using visual studio 2005 only.
I am building a forum and I want to use forum-style tags to let the users format their posts in a limited fashion.Currently I am using Regex to do this.As per this question:How to use C# regular expressions to emulate forum tags. The problem with this,is that the regex does not distinguish between nested tags.Here is a sample of how I implemented this method:
public static string MyExtensionMethod(this string text){return TransformTags(text);} private static string TransformTags(string input) {string regex = @"[([^=]+)[=x22']*(S*?)['x22]*](.+?)[/(1)]"; MatchCollection matches = new Regex(regex).Matches(input); for (int i = 0; i < matches.Count; i++) var tag = matches[i].Groups[1].Value; var optionalValue = matches[i].Groups[2].Value; var content = matches[i].Groups[3].Value; Now,if I submit something like [quote] This user posted [quote] blah [/quote] [/quote] it does not properly detect the nested quote.Instead it takes the first opening quote tag and puts it with the first closing quote tag.Do you guys recommend any solutions?Can the regex be modified to grab nested tags?Maybe I shouldn't use regex for this?
I'm having problem in inserting text from a textbox in which user write or copy some text which may contain special characters ( " , . ) etc. If there is any special character it get conflict with CommandText Syntax and generates error in inserting. I want to insert all these characters. How could i do it?
For reporting we used report RDLCs and displayed using an ASPX form. We implemented using the route as shown below. This resulted in forcing us to use the page route below and also to use the hyperlink instead of the normal Action Link. The question is how do we convert the asp:hyperlink ASPX syntax to Razor syntax.
Is there a way to apply your own CSS tags to <li> tags when using ASP .NET 4.0 menu control? For example, say I have an external style sheet that has tags "class1", "class2", "class3", and etc. I want to apply "class1" to the first menu item. Then if menu item is selected, I want to apply "class2" and if it's not selected, "class3". I played with various 'Static' styles, but just can't get it work. I finally gave up and created my own menu control that extends ASP .NET menu control and provides my own custom rendering. This works, but I'm wondering if there is a way to get it work with built-in menu control.
I am working with a sql server database with about 50 stored procedures. The database and stored procedureswere not created by me. The stored procedures all begin with a number in their name.
Example: 17P_Comsetter
The problem I am having is that if I try and execute the stored procedure at the command line in Query Analyzer,the query analyzer appears not to like that the stored procedure begins with a number. For example:
If I try an run the stored procedure as follows:
EXEC 17P_Comsetter
Then I get the following error message:
Msg 102, ..... Incorrect Syntax near '17'
I am using SQL server 2005. Does anyone know why I am getting this error message?