Showing posts from April, 2013

Sharepoint 2010: Enable Anonymous: All The Errors And Problems (i hope)

so i started working is SP, yey me!!
yesterday we wanted to set the Anonymous Extension and it didnt work!!
so thx to our DEAR Team Leaders Eran and Assaf!!

the begining - u dont need me for that, so many tutorials lets just sum it:
Central Admin, Manage Web App, Authentication Providers, Default, Enable Anonymous Access.
Anonymous Policy - No Policy.

the issue: Site Settings => Site Permissions => Anonymous Access: you dont see it!!
1. are you on your admin site or on the anonymous site? you can only set and see that on the anonymous site.
2. hey wait - i am on the anonymous site and cant get in to the administrative part! cant log in!, well that obvious, its anonymous access, go to IIS, ur site, Authentication and enable Windows Authentication. dont forget to disable that in the end.
3. copy ur admin web.config to ur anonymous site web.config, there r many permissions there that dont let u do administrative stuff. later learn that and harden security, or save the o…

Jquery UI autocomplete with Ajax: master

stage 4: master
sometimes you would like to do more, usually with the _renderItem, lets see that

$(function () {
$.ui.autocomplete.prototype._renderItem = function (ul, item) {
    return $("<li></li>")
      .append("<a>" + + " <br><span style='background-color:blue'> " +  item.time + "</span><br>" + + "</a>")
      .append("<a href='default.aspx'>go go go</a>")

    source: function (request, response) {
url: "Handler1.ashx",
        data: "Name=" + request.term,
        success: function (data) {
          response($.map(data, function (item) {
            return {
              name: item.Name,

Jquery UI autocomplete with Ajax: the advanced stage

stage 3: advanced
so we have a few cool functions with this autocomplete.
1st thing is that we can return complex data, say we return an object:

publicint ID { get; set; }
publicstring Name { get; set; }
publicDateTime CreationTime { get; set; }

publicvoid ProcessRequest(HttpContext context)
List<AnObject> l = newList<AnObject>();

Jquery UI autocomplete with Ajax: the novice stage

stage 2: novice
we will try to understand that thing a bit with our own server side.
add new item, choose Generic Handle, th filename will be Handler1.ashx.
paste this:
publicvoid ProcessRequest(HttpContext context)
context.Response.ContentType = "text/plain";
  JavaScriptSerializer jss = newJavaScriptSerializer();
  var x = newstring[] { "ariel", "avraham", "aviel", "eliyahu", "eliezer" };

client side paste this
$(function () {
$("#MyTextBox").autocomplete({ source: "Handler1.ashx" });

yep, the autocomplete source can get a pure handler. try it and see that we now have our own handler, now lets make it ajax with server side filter, start with asking for the same data but with the filter function
source: function (request, response) {

Jquery UI autocomplete with Ajax: the idiotproof to master full guide

i decided to write this post cuz this thing tool my like an hour or 2 to get, and while looking at my solution i saw i should have got it in 2 seconds, so like other places sometime the examles are just not simple enough, so lets go.

stage 1: idiot proof
i'll do everything from the begining, download jquery ui 1.9.2 from their site. i opened an empty web app, added the jquery-ui-1.9.2.custom.js and the jquery-1.8.3.js and write html:

and then JS:
$(function () {
    source: [ "ariel", "avraham", "aviel", "eliyahu", "eliezer" ]

and run, thas it u have a working auto complete. now in order to have my array from a request i could just do this:
url: "default.aspx/BringMeListFromWebMethod",
contentType: "application/json; charset=utf-8",
type: "POS…