ASP & ASP.NET Code

Okay,

In the past I have tried to get Classic ASP and ASP.NET code to work when copying it inside an HTML page in Percussion that has either an .asp extension for classic or .aspx for .net. None of the code ever works.

I just did a test today and published a page with a .asp page to the server and then went in and edited the .asp page with my local code editor. Checked the page and my ASP code worked.

If someone was to go to the page in percussion and update text in the widget, will it overwrite my ASP code?

Matt,

Whatever changes you made to this page manually on the filesystem will get overwritten when you run a full site publish. What exactly did you modify on the published page to get your code working?

I went to the published page and copied all of my code inside the right below where the richtext widget put the main content.

None of my code in will work in Percussion and I have quite a few pages that utilize it.

Hi Matt,

Were you inserting the code in an HTML or Rich-text widget within Percussion? If it was rich-text, I would recommend placing it inside of an HTML widget instead. Inline ASP code will get stripped out of a rich-text widget.
-Jon

It was in a HTML widget and it just placed it on the page like normal text. It didn’t recognize the asp code.

Hey Matt,

It might’ve been a typo on your end, but note that the Rich Text widget doesn’t support server side code. You’ll want to instead place this code inside an HTML widget.

If this is what you were already doing, could you possibly share with me what the code block – including containing CM1 regions – looked like before and after you edited it? Thanks!

Okay. I found my issue. there was a % missing. Sorry about that. Is there not a way for the ASP code to not show in the widget inside Percussion? I’m having to use some code inline and it’s displaying passwords to people that really don’t need to be able to see it.

Depending on what your ASP code returns, you can wrap certain portions of the code it in HTML comments (portions that don’t directly spit out HTML, otherwise the resulting HTML will still be hidden from the browser). These comments will obviously be ignored by the server when processing the ASP code, and it’ll make it so that the code blocks don’t appear to your end users when editing these pages.

Well when I put in this code

 

When you look at the page inside Percussion, you can see all of the code inside the .