Wednesday 27 June 2012

Deploying SharePoint Package with stsadm

 

path C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN
stsadm -o retractsolution   -name InformationCenter.wsp -immediate -url http://sharepointSiteUrl

stsadm -o execadmsvcjobs

path C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN
stsadm -o deletesolution   -name InformationCenter.wsp

path C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN
stsadm -o addsolution -filename "c:\InformationCenter.wsp"
stsadm -o deploysolution -name InformationCenter.wsp -url http://sharepointSiteUrl -immediate -allowgacdeployment

stsadm -o execadmsvcjobs

Friday 22 June 2012

UpdatePanel initializeRequest and endRequest

$(document).ready(function() {
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandle);
            Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(initializeRequest);
            var postBackElement = "";
            function initializeRequest(sender, eventArgs) {
                postBackElement = eventArgs.get_postBackElement().id;
            }
           
            function endRequestHandle(sender, args) {
                if (!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack())
                    // Do something…                   
            }
        });

Tuesday 19 June 2012

asp.net tab doesn't show in iis

start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;^ IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;^ IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;^ IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;^ IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ManagementScriptingTools;^ IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;^ IIS-RequestFiltering;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;^ IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-IIS6ManagementCompatibility;^ IIS-Metabase;IIS-WMICompatibility;WAS-WindowsActivationService;WAS-ProcessModel;^ WAS-NetFxEnvironment;WAS-ConfigurationAPI;WCF-HTTP-Activation;^ WCF-NonHTTP-Activation

Wednesday 6 June 2012

How to dynamically resize images

http://cmsnsoftware.blogspot.com/2011/09/how-to-dynamically-resize-images.html

Raw ActionLink linkText

 public static IHtmlString MyActionLink(
this HtmlHelper htmlHelper,
string linkText,
string action,
string controller,
object routeValues,
object htmlAttributes
)
{
var urlHelper = new UrlHelper(htmlHelper.ViewContext.RequestContext);
var anchor = new TagBuilder("a");
anchor.InnerHtml = linkText;
anchor.Attributes["href"] = urlHelper.Action(action, controller, routeValues);
anchor.MergeAttributes(new RouteValueDictionary(htmlAttributes));
return MvcHtmlString.Create(anchor.ToString());
}




http://stackoverflow.com/questions/6063467/raw-actionlink-linktext

Friday 1 June 2012

Adding Custom HTTP Headers to an ASP.NET MVC Response

http://blog.gregbrant.com/post/Adding-Custom-HTTP-Headers-to-an-ASPNET-MVC-Response.aspx

public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
filters.Add(new HttpHeaderAttribute("X-UA-Compatible", "IE=Edge,chrome=1"));
}



or



in web.config



<system.webServer>



<httpProtocol>


  <customHeaders>




    <add name="X-UA-Compatible" value="IE=Edge,chrome=1" />


    <remove name="X-Powered-By" />




  </customHeaders>


</httpProtocol>




</system.webServer>