Posts

Showing posts from July, 2013

how to use XslCompiledTransform, XSLT in c# (server side), and how to use it with Sharepoint

scenario 1: I just want to do XSLT in server side:
in most examples on the web u'll see stuff like this:

// Load the style sheet. XslCompiledTransform xslt = new XslCompiledTransform(); xslt.Load("output.xsl"); // Execute the transform and output the results to a file. xslt.Transform("books.xml", "books.html"); now many times u'll and want to use the XmlReader and the XmlWriter classes, and there u'll start getting exceptions. The main reason is that those 2 classes really check for your XML, XSL and the output, so unless ur a goody good boy with XML-XSL its really annoying. One main example is that in my scenario I want to create a chunk of HTML but as a DIV, not a whole document, so you need to explicitly tell that to the result output.

so there r ways to continue and be a goody good boy and the only place I found good and exact info about all that is here: http://stackoverflow.com/questions/6214354/problem-with-xslcompiledtransform-and-…

Sharepoint ConnectionString for Jobs

THX to Elitzur and Eran for this one!!!

if u ever make a job in SP and in the job u want to get a connectionString from our beloved ConfigurationManager you will not find it!

this is becuz the OWSTIMER process (SharePoint Timer Service) has its own config file.

go to your 15\BIN (or 14\BIN) and find OWSTIMER.EXE.CONFIG and put ur connStr there.
dont forget to refresh the OWSTIMER.

some more info about jobs (for noobs like me XD):
jobs r running in the OWSTIMER process and therefor dont have any context(es) with them, so you cant cache stuff (my original will), you dont have ur web.config and other IIS related stuff.



Html Table Pagination: Real True and Complete (and Simple) Javascript with JQuery

i did a mixture and optimization from these 2:
http://gabrieleromanato.name/jquery-easy-table-pagination/
http://dotnetcluster.blogspot.co.il/2011/07/paging-in-html-table-using-javascript.html

now it has <<first, <<prev, 5,6,7,8,9 next>> last>>

i also added it to my Bresleveloper.js lib:
http://bresleveloper.blogspot.co.il/2013/06/my-extenxtion-javascript-namespace.html

<scripttype="text/javascript">
$(function () {
$('table.paginate').each(function () {
var $table = $(this);
var itemsPerPage = 10;
var currentPage = 0;
var pages = Math.ceil($table.find("tr:not(:has(th))").length / itemsPerPage);
$table.bind('repaginate', function () {
  if (pages > 1) {
  var pager;
  if ($table.next().hasClass("pager"))

Regex Not Operator

^((?!regexp).)*$