Monday, January 27, 2014

ASP.NET 4.0 ClientModID


We can use control ID in script (insiede html page or js file) without using ClientID clause

like we have
<asp:textbox  id="txtID"  runat="server" text="0"></asp:textbox>
in order to get its value in script we need to write

'<%= txtID.ClientID %>'
 to manipulate its value , but now we can set ClientIDMode property to access controls just like we access html controls in script

<asp:textbox clientidmode="Static" id="txtID"  runat="server" text="0"></asp:textbox>

we can access its value in script

('@txtID').val();



http://weblogs.asp.net/asptest/archive/2009/01/06/asp-net-4-0-clientid-overview.aspx
http://stackoverflow.com/questions/5666011/retrieve-id-of-server-control-using-jquery

Thursday, January 23, 2014

Validate an XML File

http://www.xmlvalidation.com/

Window btoa() Method

http://www.w3schools.com/jsref/met_win_btoa.asp

SqlCommand.CommandTimeout Property




With SqlCommand.CommandTimeout property we can set times in seconds to wait for the command to execute. The default is 30 seconds

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout.aspx 
http://stackoverflow.com/questions/7023740/sqlcommand-object-what-length-of-time-for-commandtimeout 

How To Use HTML Code Inside Blog Post In Blogger


http://www.ebloglive.com/2012/06/how-to-use-html-code-inside-blog-post.html

Online Html encoding/decoding

http://htmlentities.net/

Wcf-The maximum message size quota for incoming messages (65536) has been exceeded?

Set following parameters in your web.config

<bindings>
      <basicHttpBinding>
        <binding name="bindingName" maxBufferSize="2147483647"
         maxBufferPoolSize="2147483647"
         maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="2147483647"
                  maxStringContentLength="2147483647"
                  maxArrayLength="2147483647"
                  maxBytesPerRead="2147483647"
                  maxNameTableCharCount="2147483647" />
        </binding>
      </basicHttpBinding>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IApiService" />
        <binding name="WSHttpBinding_IApiService1" />
      </wsHttpBinding>
    </bindings>


http://stackoverflow.com/questions/19564047/wcf-the-maximum-message-size-quota-for-incoming-messages-65536-has-been-exceed

Comapare Date in Linq to Sql



I had the requirement to compare Date in Linq to Sql, i have 2 option to use :
in one case i can use myDate.Date it will also return date part with 12:00:00 AM time string too. To get only date part we need to use
date_modified1.Date > modified_date2.Date // retunrn date part + 12:00:00 AM

EntityFunctions.TruncateTime(date_modified1)>
EntityFunctions.TruncateTime(modified_date2) return Date part only

http://stackoverflow.com/questions/10647360/linq-to-sql-to-search-only-date-portions-of-a-date