Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. WSS web parts and javascript integration

WSS web parts and javascript integration

Scheduled Pinned Locked Moved Web Development
javascriptcsharpcssasp-netsharepoint
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris McGlothen
    wrote on last edited by
    #1

    My company is working towards adopting a branded SharePoint Intranet powered by WSS 3.0. I have been given the task of creating some reuseable web parts for the various divisions. Honestly I'm excited and anxious to learn about and develop these parts of the whole. My problem comes from trying to reference a javascript scroller (Thanks DynamicDrive) within a WSS web part. I've already implemented this functionality with in a current ASP.NET portal page, but when I try and do the same in WSS I'm unable to get the .js file to communicate with the rest of the web part. Here is where I'm at right now. Within the WSS page I have the .js file set as an embedded resource. I register the ClientScript in the overridden OnPreRender method //this is the call to reference the javascript code, this must be referenced always with the format 'AssemblyName.FolderName.Javascript FileName' this.Page.ClientScript.RegisterClientScriptResource(this.GetType(), "Scroller.Resources.Scroller.js"); //This is the link to the javascript css page for the scroller, this must also be referenced 'AssemblyName.FolderName.Javascript FileName' string scrollerCSSLink = ""; this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ScrollerCssLink", scrollerCSSLink, false); Then within the overriden CreateChildControls method I call another function (getData()) that incorporated a StringBuilder to put together the content and bind the data for the scroller itself, which comes from a document list within the SharePoint page itself. string body = string.Empty; string url = string.Empty; //These two variables ensure that each instance or call to the function have unique IDs string content = this.ClientID + "_content"; string scroller = this.ClientID + "_scroller"; string newContent; string placeKeeper; string ScrollerClass = "pausescroller1"; int i = 0; try { //Try and get the List SPWeb web = SPContext.Current.Web;//current running Shpoint site SPList list = web.GetList(ListName); StringBuilder sb = new StringBuilder(); sb.Append("

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups