Monday, December 3, 2012

Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive

 Two reasons

1. Application Pool for your site is configured for .NET Framework Version = v2.0.XXXXX .NET 4.
2. .net 4 not installed to your server

Wednesday, November 14, 2012

Clear FileUpload filename

We can do this using javascript. Please refer below code sample


<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<script type="text/javascript">
    function clearFileInputField(divId) {
        document.getElementById(divId).innerHTML = document.getElementById(tagId).innerHTML;
    }
</script>
    <asp:Label ID="Label1" runat="server"></asp:Label>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <div id="divFileUp3">
  <asp:FileUpload ID="fileUpload1" runat="server"   />
</div><asp:Button runat="server" Text="Remove" OnClientClick="clearFileInputField(divFileUp3)"/>
    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
 

Thursday, November 1, 2012

Saving Changes Is Not Permitted On SQL Server 2008 Management Studio

To allow you to save changes after you alter table, do disable prevent changes:


  1. Open Microsoft SQL Server Management Studio 2008
  2. Click Tools, then click Options
  3. Click Designers
  4. Uncheck prevent saving changes that require table re-creation
  5. Click OK
  6. Try to alter your table

Thursday, October 4, 2012

RESTORE cannot process database 'db name' because it is in use by this session.

My issue was I was restoring a database that I also was using as my default database.

So, by changing my user default database to the master db, I was able to restore.

Wednesday, September 19, 2012

The selected stored procedure returns no columns

The reason was, selecting from a temp table and EF can’t figure out the shape of the results at design time.

The solution for this write this line "SET FMTONLY OFF" in begin part of your Stored Procedure but it will not work in selecting data from another database.
Example : Create procedure SPname
      as
      SET FMTONLY OFF 

Thursday, September 13, 2012

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I got this when i trying to read a CSV file and trying to get the data in a DataSet using Microsoft Text Driver in your 64 bit machine.

Solution
  1. Go to IIS and Application Pools in the left menu.
  2. Click the project name in the listing.
  3. Click the Set Application Pool Defaults.
  4. In General Tab, make the Enable 32 Bit Application entry to "True"

Monday, September 3, 2012

CheckOut Authentication Failed Nopcommerce

This is due to configuration issues with your shipping method. Please provide valid configuration details. Learn more Programing Tips and new Features


Wednesday, August 22, 2012

An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter

I got this error when i redirect to another action with parameters.
In my case, the problem was parameter name. Add correct parameter.

return RedirectToAction("ProductTryout", new RouteValueDictionary(new { controller = "Catalog", action = "ProductTryout", productId = model.Id }));

Monday, August 20, 2012

A generic error occurred in gdi+

You can not save the same bitmap which is being used by other process. So rename it and then try to save

Wednesday, August 15, 2012

A route named could not be found in the route collection. NopCommerce

Go to the Nop.Web.Infrastructure.RouteProvider.cs
Add  following Code 
routes.MapLocalizedRoute("YourLink",
                            "customer/YourLink",
                            new { controller = "Customer", action = "YourLink" },
                            new[] { "Nop.Web.Controllers" });


Monday, July 30, 2012

How to Run WAMP Server Parallel with IIS 7 on Windows

When you already have IIS running then you may not be able to run WAMP Server at Localhost. You need to shutdown IIS in order to run WAMP Server properly.

To run WAMP Server parallel with IIS 7, we need to assign port 8080 to WAMP Server so that it runs on http://localhost:8080 and IIS 7 runs on http://localhost

To do this, click on WAMP Server icon on taskbar and go to Apache > httpd.conf
httpd.conf file will be opened. Change ‘Listen 80’ to ‘Listen 8080’ (As shown in the screenshot). Save and restart WAMP.

Now you can access WAMP Server access on http://localhost:8080
And at http://localhost IIS 7 will be running.

Thursday, July 26, 2012

Free shipping over X Nop Commerce

 I you had a problem with Free shipping over X, i would recommend that you check to be sure

1) you don't have any discounts set up (Category, Role, etc.),
2) your product item has
  a) Is Shippable - checked
  b) Free Shipping - not checked
  b) No per item additional shipping charges

Learn More new features and programing Tips from


Thanks

Wednesday, July 25, 2012

Installing DotNetNuke using SQL Server 2005/2008 as your database server

1.Download the latest stable release of DotNetNuke, using the INSTALL package
2.Extract the contents of the ZIP package to a folder on your computer.
3.Create a directory in the c:\inetpub\wwwroot\ folder called DotNetNuke which would look like c:\inetpub\wwwroot\dotnetnuke\
4.Copy the contents of the extracted DNN INSTALL package to the c:\inetpub\wwwroot\dotnetnuke\ folder
5.Go to the properties of the c:\inetpub\wwwroot\dotnetnuke\ folder, click on the Security tab, be sure to add the permissions for the appropriate user (WinXp/2000 uses the local ASPNET account, Win2003/Vista/2008/7 use the local Network Service account). Give this account modify permissions on the folder
6.Open up the the web server IIS Console, start->run->INETMGR
7.Expand the websites node
8.Expand the default website node
9.Right click on the dotnetnuke folder under the default website, click on Convert to Application, if you don't have that option, choose properties and then add the application.
10.Open up SQL Management Studio (2005/2008), or Enterprise Manager (2000)
11.Connect to your database server (might be local)
12.Expand the server node (name of the SQL server/computer) and right click on the Databases node, choose New Database.
13.Define the database name and other properties, click OK to create the database.
14.Configure the SQL User Security/Account
  1. SQL User Security (requires mixed mode authentication to be enabled in SQL Server)
    1. Right click on Server/Security and choose New Login
    2. Define new SQL Server authentication login information, username/password.
    3. From the User Mapping section choose the new DNN database and configure the db_owner role membership. Click OK 

 15.Browse to your website using http://localhost/dotnetnuke
16.Step through the installation wizard, use Typical or Custom.
17.When you get to the database screen you need to choose SQL 2000/2005/2008 (not the SQL Express option)
  1. If you have only one instance of SQL running on your server, and you intend on using the SQL instance on your machine, you can enter a '.' for the database location or use (local) as the local instance name (the brackets are necessary(. Otherwise, if you have more than one instance of SQL running on your localhost (SQL2005, SQL2008Express, SQL2008) and you are going to use one of the local instances enter a period followed by a slash and the instance name. For example '.\SQL2008'     
18.Depending on your choice at step 14, you should choose to use or not use integrated security.
  1. Integrated Security (no changes)
  2. Not using Integrated Security
    1. Uncheck Integrated Security
    2. Type in the Username and Password from steps 14-b-ii-iii 

    19.Test the database connection, if successful continue
    20.Step through the remainder of the installation wizard configuring the Host and Admin accounts.



Friday, July 13, 2012

Hide menu items by customer role NopCommerce 2.4

Admin>Configuration>Settings>General and miscellaneous settings>Security settings tab enable
Hide admin menu items based on permissions.


Learn more Programing Tips and new Features




Thanks

Thursday, June 14, 2012

How to find out nopcommerce version

Go to admin area and you'll see it at the top right corner

Wednesday, June 13, 2012

How to add new tables to NOPCommerce

I spent plenty of time for delving into this problem' depths. I can summarize the solution as follows:

1. Create The Entity Class (e.g Entity.cs)

Path : Nop/Core/Domain/Entity.cs

2. Create The Mapping Class (e.g EntityMap.cs)

Path : Nop/Data/Mapping/EntityMap.cs

3. Create a Model for MVC (e.g EntityModel.cs)

Path : Nop/Admin/Models/EntityModel.cs OR Nop/Web/Models/EntityModel.cs

4. Create a validator for model (e.g EntityValidator.cs)

Path : Nop/Admin/Validators/EntityValidator.cs OR Nop/Web/Validators/EntityValidator.cs

5. Create A Mapping Configuration On AutoMapperStartupTask.cs for Entity and Model

Path : Nop/Admin/Infrastructure OR Nop/Web/Infrastructure

6. Apply Mapping between Model and Entity on MappingExtensions.cs

Path : Nop/Admin OR Nop/Web

7. Create a service class and service interface (e.g EntityService.cs , IEntityService.cs)

Path : Nop/Services/EntityService.cs AND Nop/Services/IEntityService.cs

8. Update DependencyRegistrar.cs

9. Finally Create Controller and View for given model

Add language pack to nopcommerce

http://forums.asp.net/t/1813735.aspx/1?nop+commerce


Nopcommerce and ecommerce websites services


Thursday, May 24, 2012

Cannot implicitly convert type 'int?' to 'int'. An explicit conversion exists (are you missing a cast?)

I got this when i use linq query
query is below
public IQueryable<GasUtilGas> LoadAllForkliftGasUtilByDetailId(int id)
        {
            var res = from gu in db.tblForlkliftGasUtils
                      join g in db.tblGas on gu.GasID equals g.GasID
                      select new GasUtilGas { GasNo = g.GasNumber};
            return res;
        }

It seems like g.GasNumber is a nullable int field in the database.  Change the model to this:
public class GasUtilGas
    {
        public int? GasNo { get; set; }   
    }

Friday, May 11, 2012

The data source does not support server-side data paging

You can't use an IQueryable object to data bind to a GridView and still use Paging and Sorting. You must return a List to the GridView using the ToList() method. Thanks

Monday, February 20, 2012

Image upload with CKEditor.

Image upload with CKEditor.

My latest issue was how to integrate CKFinder for image upload in CKEditor. Here the solution.

1. Download CKEditor and extract in your web folder root.

2. Download CKFinder and extract withing ckeditor folder.

3. Then add references to the CKEditor, CKFinder and put
 <CKEditor:CKEditorControl ID="CKEditorControl1" runat="server"></CKEditor:CKEditorControl>
 to your aspx page.

4. In code behind page OnLoad event add this code snippet

protected override void OnLoad(EventArgs e)
{
CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
_FileBrowser.BasePath = "ckeditor/ckfinder/";
_FileBrowser.SetupCKEditor(CKEditorControl1);
}

5. Edit Confic.ascx file.

public override bool CheckAuthentication()
{
return true;
}

// Perform additional checks for image files.
SecureImageUploads = true;

Thanks

TinyMCE Insert/Edit link not editable

 To fix this add  e.stopImmediatePropagation()  as below. $(document).on('focusin', function (e) {             if ($(e.target).close...