Wednesday, July 1, 2015

ModelState.IsValid always false

Put this line above ModelState condition and check the values you getting for variable errors.

var errors = ModelState.Values.SelectMany(v => v.Errors);
 
 

Tuesday, May 5, 2015

A potentially dangerous Request.Form value was detected from the client

You can see this error everytime when you submit HTML code to the server. To avoid this set validateRequest="false" in the page and in .net 4 you need to add this <httpRuntime requestValidationMode="2.0" /> to the web.config file. Thanks Lasa

Friday, January 23, 2015

Invalid anonymous type member declarator MVC

I got this error message when i use  @data-group in ActionLink.

@Html.ActionLink(cardCategory.Name, "Index", new { controller = "Home" }, new { @class = "btn btn-default btn-lg btn-filter", @data-group = "C" })

Use an underscore _ - the Razor engine is smart enough to translate that to a data- attribute.

Tuesday, December 9, 2014

Extract only emails from string using Javascript

Today I'm going to show you how to extract only email from string. This can be done using javascript. Here sample code
function extractEmails(text) {
   return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi);
 } 

Monday, November 10, 2014

An error occurred while copying image, check your memory limit. prestashop

This is not related to prestashop. You have to increase memory limit in php.ini file in your server.

I'm using fatcow as my service provider. Here the steps for solve this

  1. Log in to your FatCow Control Panel.
  2. Go to CGI and Scripted Language Support.
  3. Click PHP Scripting.
  4. Your php.ini file is displayed in a text box at the bottom. Click Edit if you cannot edit the php.ini file text.
  5. Locate the following block of code within your php.ini file:
    ; Maximum amount of memory a script may consume (128MB)
    ; http://php.net/memory-limit
    memory_limit = 32M
  6. Modify the highlighted value for memory_limit as desired (example: 35M, or 40M, or 45M).
  7. Click Save.

Tuesday, October 28, 2014

Get ASPX control value in ASCX page

Hello,

To achieve this scenario, you have to first define public property in aspx page like this.
public DropDownList AffinityGroupDDL
        {
            get
            {
                return ddlAffinityGroup;
            }
        }

After that you can access your page controls like below
var dropDownList = ((StMainDashboard)Page).AffinityGroupDDL;

Try this.

How to Create Events Using Microsoft Graph API with Delegated Permissions and MSAL.js

Microsoft Graph API provides powerful capabilities to interact with Microsoft 365 services. In this guide, we’ll explore how to create calen...