Loading ...

ASP.NET Blogs | CodeAsp.Net - Page 5

  • While working with ASP.NET multiline textbox I realized that MaxLength property was not working, it seems it was bypassed by ASP.NET engine. I decided to write a small JavaScript piece of code in order to apply character limit on the textarea. Below is the code for it: $(function () { var summaryControl = $("#Summary"); var maxLength = 10
    Raghav Khunger  · 9/29/2013  · 0  · 2335
    asp.net javascript jquery
     /5
    Avg: 0 / 5 (0votes)
  • SQL Server: Get list of all constraints
    Below is the SQL query to get all constraints: SELECT TableName = t . Name , ColumnName = c . Name , dc . Name , dc . definition FROM sys . tables t INNER JOIN sys . default_constraints dc ON t . object_id = dc . parent_object_id INNER JOIN sys . columns c ON dc . parent_object_id = c . object_id AND c . column_id = dc . parent_column_id Below is t
    Raghav Khunger  · 9/27/2013  · 0  · 2152
    Sql sql-server constraints
     /5
    Avg: 0 / 5 (0votes)
  • While working with IE7 one of our pages was giving Operation Aborted error. I was getting the following screen: The reason for this error was that I was trying to add new elments to body tag via script, and this scrip[t element was written before the body closing tag. The solution was to wrap the script code with $( document ).ready() , like this:
    Raghav Khunger  · 9/27/2013  · 0  · 1836
    javascript jquery ie7
     /5
    Avg: 0 / 5 (0votes)
  • If you want to load external JavaScript file dynamically i.e via JavaScript code you can take help from the following code: var loadJs= function (src, callback) { var s = document.createElement('script'); document.getElementsByTagName('head')[0].appendChild(s); s.onload = function() { //callback if existent. if (typeof callback == &
    Raghav Khunger  · 9/27/2013  · 0  · 2669
    javascript jquery
     /5
    Avg: 0 / 5 (0votes)
  • Below is the query which you can use to shrink the transcation log: USE AdventureWorks2008R2 ; GO -- Truncate the log by changing the database recovery model to SIMPLE. ALTER DATABASE AdventureWorks2008R2 SET RECOVERY SIMPLE ; GO -- Shrink the truncated log file to 1 MB. DBCC SHRINKFILE ( AdventureWorks2008R2_Log , 1 ); GO -- Reset the database rec
    Raghav Khunger  · 9/12/2013  · 0  · 2235
    Sql
     /5
    Avg: 0 / 5 (0votes)
  • Add strong name to reffered assembly
    While working with one of my project I was getting message "Could not load file or assembly 'tika-app, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required." I was sure I was having strongly named dll TikaOnDotNet and tika-app dlls which I was using so where was t
    Raghav Khunger  · 8/31/2013  · 0  · 17114
     /5
    Avg: 0 / 5 (0votes)
  • If you have the image data in System.Drawing.Image and want to bind that to ASP.NET Image control following code will help you: System.Drawing.Image img = System.Drawing.Image.FromStream(xx); // Your source image string base64ImageString = ConvertImageBytesToBase64 (ImageToByteArray(img)); contactImage.ImageUrl = string.Format("data:image/jpg;
    Raghav Khunger  · 8/30/2013  · 0  · 6313
    asp.net image
     /5
    Avg: 0 / 5 (0votes)
  • Detect if a dll is strongly named via ildasm
    If you want to see whether your dll is strongly signed or not you can check that via ildasm . Navigate to C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\ildasm.exe and open the dll you want to check. If it is showing some value of public key this means it is strongly signed and if it is not showing the value it means it is not strongly sig
    Raghav Khunger  · 8/30/2013  · 0  · 1886
    dll signing ildasm
     /5
    Avg: 0 / 5 (0votes)
  • Detect if a dll is strongly named via Reflector
    If you want to see whether your dll is strongly signed or not you can check that via Reflector . Load your dll in Reflector and focus on PublicKeyToken value. Reflector will show you information like this: // Assembly Newtonsoft.Json , Version 4.0.5.0 Location: D:\SampleProjects\GoogleContactsSample\GoogleContactsSample\bin\Newtonsoft.Json.dll Name
    Raghav Khunger  · 8/30/2013  · 0  · 1978
    dll reflector signing
     /5
    Avg: 0 / 5 (0votes)
  • Git: error: RPC failed; result=18, HTTP code = 200
    After pushing some large dlls into our repository I noticed the other users of that repository were getting the following error while Taking PULL: "C:\Program Files (x86)\Git\bin\git.exe" pull --progress "origin" fatal: early EOF fatal: The remote end hung up unexpectedly fatal: unpack-objects failed error: RPC failed; result=18
    Raghav Khunger  · 8/30/2013  · 0  · 7562
    git git-extensions visual-studio
     /5
    Avg: 0 / 5 (0votes)
  • I decided to work with the TikaOnDotNet project today. For that I downloaded the dlls via Nuget. But after downloading them I was getting the following compilation error: Referenced assembly TikaOnDotent does not have a strong name Solution: The solution was to make it strong name. Since I was not having the source code for that dll I made the stro
    Raghav Khunger  · 8/30/2013  · 0  · 1844
    dll tikaondotnet
     /5
    Avg: 0 / 5 (0votes)
  • Below is the code to show how to pass params to jquery trigger function: $('#TestAnchor').on('foo', function(event, param1, param2) { alert(param1); alert(param2); }); $('#TestAnchor').trigger('foo', ['one', 'two']); Live: http://jsfiddle.net/raghav_khunger/MwzJh/
    Raghav Khunger  · 8/28/2013  · 0  · 1914
    javascript jquery
     /5
    Avg: 0 / 5 (0votes)
  • The length of the URL for this request exceeds the configured maxUrlLength value
    I was getting the following error on one of our page: The length of the URL for this request exceeds the configured maxUrlLength value. Fix : Fix was to Update MaxUrlLength of httpruntime section in web.config to somewhat greater say 1024 characters:
    Raghav Khunger  · 8/24/2013  · 0  · 4916
    asp.net
     /5
    Avg: 0 / 5 (0votes)
  • Following are the outcomes of my test which I did in my ASP.NET site with app pool set as "Network Service" identity. I did these tests with Forms Authentication.. Case 1: When impersonation is false i.e <identity impersonate="false" /> System.Security.Principal.WindowsIdentity.GetCurrent().Name will give "NT
    Raghav Khunger  · 8/24/2013  · 0  · 3920
     /5
    Avg: 0 / 5 (0votes)
  • Fix: Type xx in Assembly xx is not marked as serializable
    I added few properties in one of our Business classes in our application Communifire.I started getting the following error: Type 'xxx' in Assembly 'ScheduleWidget, Version=2.2.0.0, Culture=neutral, PublicKeyToken=7df720a1c4851830' is not marked as serializable I knew I didn't add [Serializable] attribute to new property which co
    Raghav Khunger  · 8/10/2013  · 0  · 4536
     /5
    Avg: 0 / 5 (0votes)
  • While working with our product Communifire one of our clients was facing an issue regarding axd files, the WebResource.axd and ScriptResource.axd files were not working i.e they were giving the following error: Specified argument was out of the range of valid values. Parameter name: utcDate
    Raghav Khunger  · 8/4/2013  · 0  · 2734
    4.83 
     /5
    Avg: 4.83 / 5 (1votes)
  • After hibernating my machine having Windows 7 SP1 installed, it was doing restart everytime, this was not the expecyed behavior of hibernate feature. To fix this issue I went to "device manager" and noticed that "Allow this device to wake the computer" setting was checked in "Power Management" tab of properties of Mous
    Raghav Khunger  · 8/1/2013  · 0  · 1786
    windows7 hibernate
     /5
    Avg: 0 / 5 (0votes)
  • Windows 7: Add unallocated space to existing partition
    I noticed on my machine that I was having 1.75 GB unallocated space. I decided to reclaim that space and add that to my "D" partition. For that I did the following steps in command prompt: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Windows\system32>diskpart Microsoft DiskP
    Raghav Khunger  · 7/24/2013  · 0  · 13292
    windows-7
     /5
    Avg: 0 / 5 (0votes)
  • Change text to Hindi from English on typing inside text box
    If you want to change text from english to hindi as you type in the textbox the following code can help you: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <script type="text/javascript" src="https://www.google.com/jsapi"&
    Raghav Khunger  · 7/23/2013  · 0  · 10678
    hindi
     /5
    Avg: 0 / 5 (0votes)
  • Twitter bootstrap multiple modals not working, browser crashing
    Today I was trying to open multipl Twitter bootstrap modal one above the other i.e in stack. After the second modal initiate script ".modal('show')' the Chrome was getting crashed. Below is the screen which I was getting after trying to to open the second modal from the first modal.
    Raghav Khunger  · 7/21/2013  · 0  · 6770
    javascript bootstrap twitter-bootstrap
     /5
    Avg: 0 / 5 (0votes)
  • Resharper: Force braces in if-else, for and foreach loops
    I use to write curly braces for if-else, for and foreach loops even if they are of single line statements. If you want to to force Resharper to add it you can do that via Resharper > Options > C# > Formating Style > Braces Layout You need to set the "Add Braces" option to all the highlighted options in the abov
    Raghav Khunger  · 7/20/2013  · 0  · 2650
    Resharper
     /5
    Avg: 0 / 5 (0votes)
  • Hibernate option missing in Windows 7
    In order to enable hibernate option you can try the following methods: Run "powercfg -h on" command in command prompt with admin rights. Set the following DWORD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\HibernateEnabled" value to 1 in registry: If you are still not able to see the hibernate option you need to do
    Raghav Khunger  · 7/20/2013  · 0  · 2352
    windows7 hibernate
     /5
    Avg: 0 / 5 (0votes)
  • If you are experiencing this issue where Forms authentication is not working in IE10 this blog will help you. Microsoft has released a hotfix for it http://support.microsoft.com/kb/2600088/en-us After applying it on my machine Forms authentication started working in IE10
    Raghav Khunger  · 7/10/2013  · 6  · 2220
     /5
    Avg: 0 / 5 (0votes)
  • While working with web.config configuration on parent - child sites, both ASP.NET one I was getting the following error in the parent site: An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode. Issue: The issue was because of the following tag " <location path="." inheritInChildApplicati
    Raghav Khunger  · 7/9/2013  · 0  · 3811
    asp.net
     /5
    Avg: 0 / 5 (0votes)
  • While deploying a new application for our our product Communifire as a child application of exisiting site we were getting: "Could not load file or assembly 'assembly name' or one of its dependencies. The system cannot find the file specified." Reason: The reason why we were getting this error because the child site was taking the
    Raghav Khunger  · 7/5/2013  · 0  · 1893
    asp.net web.config iis-7
     /5
    Avg: 0 / 5 (0votes)
Clear filter

Filter Blogs

Top Producers

Quick Vote

What kind of email newsletter would you prefer to receive from CodeAsp.Net?