Developer forum

Forum » Development » Implement a customer created code on site.

Implement a customer created code on site.


Reply
 The client wants a page to tell the time. As a solution they have delivered some code to use that we need to upload on the server. The code consists of:
- One asp.NET page and one dll file. I am unsure as to how to implement this code correctly.

The solution that this code is suppose to run on, is www.chrisco.dk.
I cannot attach the code at present time.

How do I test if this code can run on the solution?

Replies

 
Reply
Hi there,

If you just want to tell the time, take a look at the global date and time tags: http://templates.dynamicweb-cms.com/TemplateTags/Dynamicweb-template-tags/General-tags/Global-template-tags/GlobalServer.Date.aspx

Alternatively, you can create a notification subscriber. For an Intro, take a look here: http://devierkoeden.com/Articles/[CatId/1]/Notification-Subscribers.aspx

You can use something like this:

[Subscribe(Dynamicweb.Notifications.Standard.Page.OnGlobalTags)]
public class GlobalSessionTags : NotificationSubscriber
{
  public override void OnNotify(string notification, NotificationArgs args)
  {
    Dynamicweb.Templatev2.Template template = (args as Dynamicweb.Notifications.Standard.Page.PageviewNotificationArgs).Template;
    template.SetTag("Global:Whatever", DateTime.Now);
  }
}

And then use a template tag like this in your page:

<!--@Global:Whatever-->

Since Whatever is a DateTime, you get all the date time extensions for free: http://templates.dynamicweb-cms.com/TemplateTags/Dynamicweb-template-tags/General-tags/Date/time-tag-extensions.aspx

If all this doesn't help, I think you'll need to provide more information about what it is you want to accomplish.

Cheers,

Imar
 
Reply
 Thanks for the quick reply. My problem is that our client have supplied us with some code, that they want to run on their server. We need to find out is that code can run on their DynamicWeb solution. Please contact me if you need more information.

mail: tom@innovisio.dk
 
Reply
I have attatched the code that our client wants to run on their DynamicWeb site.
 
Reply
 uploaded :)
 
Reply
Is this what they literally want? Or is this just a demo project to see if they can inject some code into a Dynamicweb page? The only thing the sample project does is output DateTime.Now.ToLongTimeString(); on a Literal in an ASPX page.

The way it's set up now, you can't directly use this code in a Dynamicweb page. Depending on what exactly they want to do, you can use the default Dynamicweb templates, or you can ask your client to create a NotificationSubscriber instead of an ASPX page.

Hope this helps,

Imar
 
Reply
 Thanks for the response. Thats exactly what I needed to know :)

 

You must be logged in to post in the forum