How To avoid assembly registration in Web.Config for the Object Data Source

It’s very common to use object data source to bind the grid , formview etc but the problem is Assembly registration in web.config specially in multi server farm.
In order to avoid the registration of your assembly in web.config file just follow two simple steps as mentioned below.

Step-1

In your UserControl ASCX file add assembly directive

<%@ Assembly Name=”ILX.MKS.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=123a45b9c456789″ %>

    Step-2

    In object data source give fully qualified type Name like below

    TypeName=”ILX.MKS.Business.UserRegistration, ILX.MKS.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=123a45b9c456789″

 
Note: –
There are pros and cons of the above option, this is helpful if you do not want to touch the web.config file, otherside is if you maintain in web.config then  will be central location to maintain
the assembly reference.

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s