Embed FoxPRO commands in Dreamweaver - dreamweaver

is it possible to embed FoxPRO commands such as <%= and %> into Dreamweaver? My program keeps on getting trashed in live preview T.T
This code for instance
<%=INSERTHTML([PURSTRAP],CHR(60)+CHR(33)+[-- HEADERJS_BEG --]+CHR(62),CHR(60)+CHR(33)+[-- HEADERJS_END --]+CHR(62))%>

Related

Web based code editor with auto completion

guys
I'm building the web based code editor for my personal project.I want to make it work like VS code but facing some issues.
I'm using ACE editor.
This is what I get while trying with autocompletion.
I'm getting all the available suggestions while trying to write "os.(something)", rather then just getting the language and package specific suggestions.
What I want is this.
In this pic as you can see I'm getting suggetion related to os package only.
Depending on your setup with require-js, you may also need to include an additional javascript file in the html for your page. You need to write this simple script to working with the auto completion feature.
ace.require("ace/ext/language_tools");
var editor = ace.edit("editor");
editor.setOptions({
enableBasicAutocompletion: true
});
Demo: https://github.com/ajaxorg/ace/blob/master/demo/autocompletion.html
Reference: https://github.com/ajaxorg/ace/wiki/How-to-enable-Autocomplete-in-the-Ace-editor
HTML, JS, CSS Based
Create <textarea onkeyup=compile() id=code>. It should be big enaugt for code.
Create <script> </script>
Build the autocomplete
Script: function compile() { document.GetElementById('code').value = document.GetElementById('code').value.replaceAll('snippet1', 'Snippet1Value').replaceAll('snippet2', 'SnippetValue'). ...
E.g.: When you enter _text_ (and you set snippet1 to <input type=text>) then your textarea will write <input type=text>. To create an picker, use a contextmenu-library at json.
I know, this is only an plan how to do is.

ASP Classic - Excel file generate empty file

I have the file testeexcel.asp used to generate excel file in classic asp:
<%# Language=VBScript %>
<%
Response.AddHeader "Content-Disposition", "attachment; filename=excelTest.xls"
Response.ContentType = "application/vnd.ms-excel"
%>
<table>
<tr>
<td>Test</td>
</tr>
</table>
but when open in excel, the file is blank. If opened in notepad++, saved and reopened in excel the file works. See the link to test 104.41.63.35/testeexcel.asp
How to configure the file or IIS to resolve this problem?
Environment: Windows server 2012 - IIS 8.5
Marco - I have had success for the last several years with exporting from my Classic ASP to Excel using the setup you show -- but this week my clients have started reporting the same issue you describe although nothing about our application has changed. I have also been looking for an answer and I believe another poster may be correct pointing out that a recent Microsoft update is the culprit.
Opening excel files from the internet opens a blank excel window
I do not have the option to uninstall the update and have found that if I select to "save and open" instead of just "open" (and select "yes" to the prompt to 'open anyway?') my spreadsheet was displayed. Hope that helps!

rails content_for not working

I want to have my javascript/coffescript files load only on the pages that use them. So in my application.html.erb file I have the following code in my head
<%= yield :head %>
Then in the specific view that I want to load the javascript I have
<% content_for(:head) do%>
<%= javascript_include_tag 'application' %>
<% end%>
This appears to work initially. When I first go to pages that I do not want javascript in, there are no links to the js files. However, once I've visited the page that has the above code block, the links show up in all subsequent pages I visit (for example the home page). If I then refresh the browser in the home page the links go away again...
This in and of itself isn't really a problem, but I also have this in my application.html.erb head section
<style><%= yield :stylesheets %></style>
and in some layouts, there is css that gets yielded to in there. Here's where it gets really weird. Let's say page A has no js and no additional css, page B has no js but does have additional css, and page C has both js and additional css. Then I do teh following in order:
Visit page A => everything is fine
Visit page B => everything is fine (additional css is loaded)
visit page A again => everything is fine (additional css is not loaded)
visit page C => everything is fine (additional css and js loaded)
visit page A again => NOT GOOD!!! (additional css and js still loaded)
somehow the javascript include tag is also causing my content_for(:stylesheets) stuff to persist even tho i don't want it to. If I do a manual refresh on page A everythign goes back to normal again until I visit page C. I've even tried putting this in my page A view to get rid of the links and still no good
<% content_for(:head) do%>
<% end%>
Any ideas?
With turbolinks enabled, it won't work. What you need to do is either disable turbolinks or put your javascript and css inside the body of your page.
Update your config/initializers/assets.rb
Either add your filename.js file or **/*.js inside
Rails.application.config.assets.precompile += %w( filename.js)
Run RAILS_ENV=production rake assets:precompile depends on your environment. If you are working locally, skip that command as it will precompile on the fly, as per your config.
Restart your app, should work with turbolinks off and yield from head or body.
I used
<% content_for :head do %>
<% end %>
But didn't use <%= content_for :head %> in my relevant layout's head tag which was the problem for me.
More these are equal
<%= content_for :head %>
or
<%= yield :head %>

Watermark and print pdf file C# asp.net 4.0

I have a pdf file stored at some location on my server. On click of a link I want to add a text-watermark to this pdf file and then print it.
something like this:
in aspx say we have a (button a link-button or a simple link)
<a id="abc" href="../test.pdf" onclick="watermarkAndPrintPdf()"> PrintPdf </a>
or
<asp:linkbutton id="abc" runat="server" onclick="watermarkAndPrintPdf()" Text="Print Pdf"/>
Now when user click this link my code should add watermark(which will probably the loged-in user name) and print this document.
I want to know what ['watermarkAndPrintPdf()'] this function will be.......
Note:-It is a web application in C# asp.net 4.0.
(I don't mind if print dialog box opens or It prints without it.)
Please help....
would suggest taking a look at PDFsharp it's an open source dll for producing pdf's through code, there are a number of examples of producing a watermark on this page of the PDFsharp website:
http://www.pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=40&Itemid=51
If you need any help using it I am more than willing to lend a hand as I have used this package to produce pdf's in the past.
hope this helps.

Add user control to web part in Sharepoint 2013

I've got a visual web part (created with standart Visual Stuido 2012 template from "Add new item" form) with just a single <div id="newsListDiv" runat="server"></div> element. I want to programmatically add my own user control to it using the following code:
protected void Page_Load(object sender, EventArgs e)
{
NewsLine newsLine = Page.LoadControl(#"~/_ControlTemplates/MainTheme/NewsLine.ascx") as NewsLine;
newsListDiv.Controls.Add(newsLine);
}
But when I deploy the solution and add the web part to the page it shows an error page, telling me that the file '/_ControlTemplates/MainTheme/NewsLine.ascx' does not exist. But if I look into folder "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES\MainTheme" I can see that the file is present there. I've tried to set the trust level to "Full" but got the same error. I also tried adding the user control in .ascx file like this:
<%# Register Src="~/_controltemplates/MainTheme/NewsLine.ascx" TagPrefix="uc1" TagName="NewsLine" %>
<div id="newsListDiv" runat="server">
<uc1:NewsLine runat="server" id="NewsLine" />
</div>
And that way a get a compilation error: "The name 'InitializeControl' does not exist in the current context". I've also noticed, that as soon as I add Register or Reference line (with the path to my user control) to my .ascx file, the .g.cs file becomes blank! And it fills up again when I remove that line. I tried many different path writings like "../_controltemplates/", "/controltemplates/15/", etc. But none of them made any difference. I'm getting desperate here, please help!
You forgot to try one more option. It's the same when accessing the _layouts folder. You should specify the 15 hive.
The correct path is "~/_ControlTemplates/15
NewsLine newsLine = Page.LoadControl(#"~/_ControlTemplates/15/MainTheme/NewsLine.ascx")
Was running into the same issue. I had not seen the suggestion for adding the 15 to the path and this worked for me. The only other difference between my reference and yours is I do not have the ~ at the start. The / is the first character.
I have this same problem only it works when I do it in code behind but I get no luck tring to add it to ascx like any other controls I use! - God Why should everything be this different in sharepoint?!!!!

Resources