I am trying to add
<meta name="google-site-verification" content="WcGeoFJE8eKgXlxMoHRDpJz1bpPFMGh25PK8M-eDlAw" />
to the section within my layout.twig . I've saved the file and uploaded it to the development version of the web site. But this HTML isn't being included.
All the other entries within the section are Twig codes. Not HTML. I am unsure if I have a cache issue and the revised version of my layout.twig isn't being loaded or if there is some Twig code I should be using for this tag?
Instead of modify the code of your application, I suggest you to proceed to the site verification with the Google file HTML verification procedure.
Simply add the Google files in the web root folder of the project, as example:
./web/googlec1f59ff86d15c795.html
And commit with your source file. In this manner the deploy procedure don't remove your files.
Another good practice, as suggested by # Pazi ツ is to act with the DNS configuration (this require you can manage the DNS site configuration).
Hope this help
My ASP.NET page has some html:
Default.aspx:
<h2><asp:Localize meta:resourcekey="lblTitle" Text="Welcome to so" runat="server"></h2>
Now i want to localize that text. So i've created a resource file Default.aspx.resx. Following the examples of Microsoft, Microsoft, Microsoft, CodeProject, and Stackoverflow i create an lblTitle.Text entry:
Except that little red error indicator's hint says,
The resource name "lblTitle.Text" is not a valid identifier.
How do i localize with asp:Localize? How do i localize with meta:? How do i create a resx?
Update: Renamed App_GlobalResources to App_LocalResources:
Web.config (partial):
<system.web>
<compilation debug="true" targetFramework="4.0"/>
Update 2: What i don't understand is that i'm following the instructions on MSDN:
To edit the resource file by using the Resource Editor
In Solution Explorer, open Sample.aspx.resx.
In the Resource Editor, under Value, are the Text properties for each
of the controls that you placed onto your page. Changing the value
here will change the value for the default culture.
Set ButtonResource1.Text to Edited English Text.
Save the file.
i've also tried
lblTitle.Text
lblTitle-Text
lblTitle_Text
lblTitle
lblTitleText
You did everything right, but put your ressource file in the wrong folder. Use App_LocalResources instead of App_GlobalResources.
See MSDN for more info on the difference between local and global ressource files:
A local resources file is one that applies to only one ASP.NET page or user control (an ASP.NET file that has a file-name extension of .aspx, .ascx, or .master). You put local resource files in folders that have the reserved name App_LocalResources. Unlike the root App_GlobalResources folder, App_LocalResources folders can be in any folder in the application. You associate a set of resources files with a specific Web page by using the name of the resource file.
A while ago I downloaded the latest version (3.1) of the CKEditor text editor.
The directory name was ckeditor and I deleted the ckeditor/_source and ckeditor/_samples sub-directories, then I referenced the ckeditor.js file in my html pages, like so :
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
This works well. To make config changes, I have been modifying the ckeditor/config.js file.
However, as of late, I have been reading various web resources that say 'do not delete the _source' folder and other such ominous messages.
What is this _source folder?
What is all the stuff at the root of the ckeditor folder? and,
What is safe to remove from the folder?
The _source folder are all the uncompressed scripts, and should be used just to read, learn and modify the code (that you must compress afterwards). It shouldn't be available in a production server.
The *.HTML files are docs for you to read
The *.php and *.asp are server integration that you don't need in the way that you are using
The *_source.js and ckeditor.pack are used to work with the _source folder and then generate the compressed version
The adapters folder includes other integration (currently jQuery)
I was wondering the same thing. I think it's explained pretty well on this page:
http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Minimum_Setup
edit I do not want to redirect pages, specific files etc. I would like to change the path where images, videos and other media are stored from the root source directory to the directory of my choosing. In this case c:/dev/prjfiles/prjname/public (c:/dev/prjfiles/prjname/ is my working directory) and i except when my html does img src="/pic.png" it will find the image in c:/dev/prjfiles/prjname/publi/pic.png. I need a working solution, i tried looking at how to set virtual directories and etc. I cant figure it out. Thus the bounty. I am generating the html, i am not writing asp:image runat="server" etc i am pulling data from a DB and outputing the html. The part that is still a WIP is the code that handles POST request. The html already exist but i cant have hundreds of files in site.com/here pollution my source directory (c:/dev/trunk/thisprj/thisprj/where my .aspx files are and i do not wish 500 .png/gif/jpg here)
I dont know how asp.net environments are usually set up. I am assuming i have a root path that is not available from the web, a bin/ where i may put my asp.net dll and a public where i stick in any files i want.
I would like to have my project files seperated from everything else. My JS, css and image files are in prjfiles/prjname/public with my sqlite db in prjfiles/prjname/ and extra binaries in prjfiles/prjname/bin.
The problem comes when i run my app and try to load an image. Such as /cssimg/error.png. My project does not find resource in my /public folder and i have no idea how to make it find them. How can i set my project up so it does?
NOTE: I set the working directory path so its at prjfiles/prjname/. In code i write ./bin/extrabin.exe and db.sqlite3 which access the files properly.
You might want to watch the getting started videos for ASP.NET
http://www.asp.net/get-started/
EDIT: More info added
As #Murph suggests, your assumptions are incorrect.
IIS takes care of blocking HTTP access to any important files and folders like your *.aspx.cs, and *.cs in the App_Code, any DLLs, anything under the App_Data directory and the web.config.
Content files, such as *.html, *.css, *.js, .gif, .jpg, .png are all served in the normal manner.
In this way, there is no need for a "public" folder.
I dont know how asp.net environments are usually set up. I am assuming i have a root path that is not available from the web, a bin/ where i may put my asp.net dll and a public where i stick in any files i want.
This is wrong assumption!
You have a root folder, which IS available in public. You set IIS or ASP.NEt Development Server to this folder.
(optional, but always needed) You have a web.config file in this root folder for configuration
You have a bin folder for your assemblies (each page or user control "include" compiles to a class)
(optional) You have App_Data as default folder for file-based DBs and/or other data files (say XML storage, ..)
(optional) You have an App_theme folder for styling and images. Read about ASP.NET themes.
(optional) You can add App_Code folder if you want to add classes to be compiled by the server.
You can create folders for scripts, etc...
Normally for complex logic, etc.. you create in a separate project outside the root and reference the result assembly in the bin folder.
Seriously, you cannot do ASP.NET work without an IDE or a manual. Visual Web Developer 2008 Express IDE is free and http://asp.net has tons of resources for getting started.
I don't know if I got the question right, but maybe you could try the <BASE> HTML tag.
HTML <base> Tag
"Specify a default URL and a default target for all links on a page"
There's a nice and simple example at W3Schools, check it out.
The negative side is that you need to put a <BASE> tag in each page you want.
It sounds like you should be able to create a virtual directory to do what you're asking -- but it's a very non-standard setup.
Keep in mind that IIS will prevent users from downloading DLLs and other project-level files, so you usually don't need to partition them off in a separate layer.
For example, just have a cssimg folder at the top level of your project, and skip the whole public folder thing.
I see where you're coming from. ASP.NET projects are set up a little differently from how you're treating them, but you can make them work like you want.
The root of an ASP.NET project IS publicly accessible. When you created your WebSite within Visual Studio, it created a default.aspx page right on the root. Are you hosting in IIS? If so, it's set up to serve up default.aspx by default. But I digress.
Here's how to make it work like you want (mostly):
Create a WebSite, then right-click the site and add a folder named "prjfiles". Right-click that folder and make another named "public". Create another subfolder of that one called "cssimg".
Now, if you want to use the image you mentioned, you'd reference it like this: "~/prjfiles/public/cssimg/error.png" (pathing starting with the root) or "./cssimg/error.png" if you're coming from a page in the public folder (relative pathing).
Really, though, you're doing too much work. Here's how to make it work with less effort:
Create your WebSite, right-click the project and add a folder called "cssimg".
Treat the root as you would the "public" folder- put your pages right there on the root or in subfolders, as needed. You can reference that same image file like this now: "./cssimg/error.png" (relative) or "~/cssimg/error.png" (start from root)
There's also another way to tell the engine where to look for resources, but it's for your css files. Inside the "head" tag, you can add a "style" element (with type="text/css") and inside that you can add something like this: #import '<%= ResolveUrl("~/prjfiles/public/cssimg/styles.css") %>';
Good luck!
If I correctly understood your problem, you're trying to find files which aren't physically stored on a filesystem folder, or stay on a different folder. You can deal with this problems by implementing a UrlRewrite mechanism.
I suggest you to read URL Rewriting in ASP.NET and, after, to take a look into this implementation: A Complete URL Rewriting Solution for ASP.NET 2.0.
If I understand all this correctly (please comment with any correction) right now all your files are together in the root directory and you use <img src="/img.png" /> and it works.
If this is the case, make another directory in the directory the images are in, say call that directory images and put the image files there. now use <img src="/images/img.png" />.
Done.
I have a resource file placed in the App_LocalResources folder inside the folder for a theme in App_Themes like so: \App_Themes\Theme1\App_LocalResources\Resources1.aspx.resx
How can I access the resources in this file from a web form in my project, assuming the web form is called Resources1.aspx having Theme="Theme1"?
You can use the "Resources" expression to extract values from the resource file, for instance:
<h1><%$ Resources: H1 %></h1>
Alternatively, and especially if you're in code-behind, use GetLocalResourceObject:
h1.InnerText = GetLocalResourceObject ( "H1" ).ToString ( );
EDIT: Sometimes i answer too fast; i don't think themes are localizable in that sense, however there are some workarounds. You could have theme specific items in the resource file and access them depending on current theme.
You can access globalresources located in \App_GlobalResources\Generic.resx with;
<%= Resources.Generic.Cancel %>
Local resources reside in an App_LocalResources folder which doesn't necessarily have to be be placed in the root folder. For a localresource it would be;
<%$ Resources:Cancel%>
or
string labelCancel = GetLocalResourceObject("Cancel").ToString();
As far as placing resource files in your theme folders go; I'd keep my themes and resources separated and programmatically switch between various resources in a site master/basepage or such by making use of globalresources.