﻿function init_Textbox(_moduleid, _iseditable) {
  var html = "";
  $.ajax({
      type: "POST",
      url: "/desktopmodules/sitebuilder/components/WebService.asmx/FetchHTML",
      // pass parameters to webmethod
      data: "{ModuleID: " + _moduleid + "}",
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      dataFilter: function (data) {
          // This boils the response string down 
          //  into a proper JavaScript Object().
          var msg = eval('(' + data + ')');

          // If the response has a ".d" top-level property,
          //  return what's below that instead.
          if (msg.hasOwnProperty('d'))
              return msg.d;
          else
              return msg;
      },
      success: function(msg) {
          // clear all current modules
          $('#placeholder').empty();
          // if data is returned, iterate through response
          if (null != msg) {
              html = msg.HTML;
              $('#lnkaddnew span span.t').html('Edit New Content');
          }
          $('#modulebody').append(html);
          SetEditControls(_iseditable, _moduleid, 'Textbox');
      }
  });
}


