Tuesday, October 29, 2013

ASP.NET, source code link

ASP.NET is a free web framework for building great web sites and applications.
http://aspnetwebstack.codeplex.com/

Monday, October 28, 2013

How to fix obtrusive JavaScript validation not working in ASP.NET MVC?

There are reasons to cause this problem. For my case is I make a new class inherit from RequriedAtribute, but not resister in the Application_Start event.

protected void Application_Start()
{
      DataAnnotationsModelValidatorProvider.RegisterAdapter(
typeof(i18n.DataAnnotations.RequiredAttribute), typeof(RequiredAttributeAdapter));
}

namespace i18n.DataAnnotations
{
    public class RequiredAttribute : System.ComponentModel.DataAnnotations.RequiredAttribute, ILocalizing
    {
        private readonly I18NSession _session;

        public RequiredAttribute()
        {
            _session = new I18NSession();   
        }

        public virtual IHtmlString _(string text)
        {
            return new HtmlString(_session.GetText(HttpContext.Current, text));
        }

        public virtual string TT(string text)
        {
            return _session.GetText(HttpContext.Current, text);
        }

        public override string FormatErrorMessage(string name)
        {
            var formatted = base.FormatErrorMessage(name);
            return _(formatted).ToHtmlString();
        }
    }
}

Thursday, October 24, 2013

Thursday, October 17, 2013

What is CDATA tag in JavaScript for?

CDATA stands for (Unparsed) Character Data, and tell XML parser NOT to parse enclosed data (Javascript).




Reference:
Definition from W3C
http://www.w3.org/TR/REC-xml/#dt-cdsection

Wednesday, October 16, 2013

How to valid email address by regular expression in C#

return System.Text.RegularExpressions.Regex.IsMatch(email, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"); 

How to copy a report in SQL Server Reporting Services from one folder to another?

1. Download to local
2. Upload to another folder

Wednesday, October 9, 2013

How to solve "Could not load file or assembly 'MySql.Web, Version=" when try to open a ASP.NET project?

Detail error message:
Could not load file or assembly 'MySql.Web, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config line 258)

Solution:
Modify Machine.config in
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config

Comment all of lines related MySql
Like following:
 
  
  
  
   
    
    
   
  
  
   
    
    
   
  
  
   
    
    
    
   
  
 

What's your favorite “programmer” cartoon?

http://stackoverflow.com/questions/84556/whats-your-favorite-programmer-cartoon

alt text

Async File Uploads in MVC 4

http://weblogs.asp.net/bryansampica/archive/2013/01/15/AsyncMVCFileUpload.aspx

Monday, October 7, 2013

Where to find CRM SDK URL in CRM 2013?

Settings -> Customizations -> Developer Resources
Organization Service,  Format like:
http://ServerName/OrgName/XRMServices/2011/Organization.svc

Thursday, October 3, 2013

How to solve problem "Cannot start Microsoft Outlook. Cannot open the Outlook window. The set of folders cannot be opened. You must connect to Microsoft Exchange with the current profile before you can synchronize your folders with your Outlook data file (.ost)."

How to solve problem "Cannot start Microsoft Outlook. Cannot open the Outlook window. The set of folders cannot be opened. You must connect to Microsoft Exchange with the current profile before you can synchronize your folders with your Outlook data file (.ost)."


Start Microsoft Exchange RPC Client Access service on Exchange Server box 

How to solve problem "E-Mail-Router: "Incoming Status: Failure - The request failed with HTTP status 403: Forbidden"

Exchange Web Services URL is wrong.

How to solve problem "Incoming Status: Failure - The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. The remote certificate is invalid according to the validation procedure."

How to solve problem "Incoming Status: Failure - The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. The remote certificate is invalid according to the validation procedure."?

Install valid certificate on CRM box

Wednesday, October 2, 2013

How to solve Error message on CRM Dashboard "you do not have sufficient privileges to view this chart. Contact your system administrator"?


Goto
Setting ->  Administration -> Users -> Client Access License (CAL) Information
Change:
Access Mode: Read-Write
License Type: Full