Posts

Showing posts from April, 2013

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

Image
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!!
solutions:
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>" + item.name + " <br><span style='background-color:blue'> " +  item.time + "</span><br>" + item.id + "</a>")
      .append("<a href='default.aspx'>go go go</a>")
      .appendTo(ul);
  };

  $("#MyTextBox").autocomplete({
    source: function (request, response) {
      $.ajax({
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:

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

publicvoid ProcessRequest(HttpContext context)
{
List<AnObject> l = newList<AnObject>();
l.Add(new

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" };
  context.Response.Write(jss.Serialize(x));
}

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
$("#MyTextBox").autocomplete({
source: function (request, response) {
    $.aj…

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 asp.net web app, added the jquery-ui-1.9.2.custom.js and the jquery-1.8.3.js and write html:

<inputid="MyTextBox"type="text"/>
and then JS:
$(function () {
$("#MyTextBox").autocomplete({
    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:
$.ajax({
url: "default.aspx/BringMeListFromWebMethod",
contentType: "application/json; charset=utf-8",
type: "POS…