.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

User messages without hard coding

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

Hi All,


How to manage user messages to avoid hardcoding messages accross the web application.





View Complete Post

More Related Resource Links

App Lockdown: Defend Your Apps and Critical User Info with Defensive Coding Techniques


Whether you're storing database connection strings, user credentials, or logon info, you'll need to practice good defensive programming techniques to avoid those surprise situations in which your data is exposed. In this article, author Kenny Kerry shows you how.

Kenny Kerr

MSDN Magazine November 2004

Best practice for user defined error messages in SQL Server 2005/2008 --Need help

My requirement is to setup a standard practice for our team in handling DB erros and also  user defined messages. We are handling exceptions using Raiseerror method with in Try and Catch blocks.  For user defined message, we are using Sp_addmessage to add our application specific error/warning messages with error codess>80000.  Ex: 80001 | Company name already exists. please check. Here is the sample code ********************************************************************* CREATE PROCEDURE [dbo].[usp_CompanyProfile_insert]  -- Add the parameters for the stored procedure here  (@company_name VARCHAR(50),  @company_code VARCHAR(3),  @user_id INT  ) AS BEGIN  -- SET NOCOUNT ON added to prevent extra result sets from  -- interfering with SELECT statements.  SET NOCOUNT ON;  BEGIN TRY -- Begin Try Block      -- Validate company name   IF EXISTS (SELECT company_id FROM companyprofile WHERE company_name = @company_name)    RAISERROR(90021, 16, 1)      INSERT INTO companyprofile (company_name,       company_code,       createdby)   VALUES(@company_name,     @company_code,     @user_id)    END TRY  -- End Try Block &

How to get current user in an action of a workflow (without .NET coding) in SharePoint Designer


Does somebody know how to get current user (logon user) in an action of a workflow definition from the Sharepoint Designer 2007. I know how to do it by using .NET coding, but it requires to upload a dll to the bin directory of the application which is not an option due to my company Sharepoint policies.

Error messages on OOB properties in User Profile


Receiving error messages on OOB properties in User Profile thus unable to edit fields:

i.e. Skills field

Error Message: There was a problem retrieving data for this field. Updating values in this field is disabled temporarily. You can still update values in other fields.

The user profile service is started and we have provisioned a Metadata Service Application and associate it with the same web application we are using for the User Profile Application. We have also associated our MySites web application with the User Profile Service.


Hard Coding Removal



I have this following where clause in a query that is being frequently used


from  Table_A

where COLUMN_A = 'ABC' and COLUMN_B IN ('d','e','f')

and COLUMN_C <> 'XYZ' and COLUMN_D NOT IN ('p','q')

and COLUMN_E LIKE 'hij%' and COLUMN_F NOT LIKE 'lmn%'

now wht i would like to do is remove hardcoding from this query. I was thinking about having a central repository like a MetaData table which will store all the values. But then how would i join this metadata table for  LIKE and NOT LIKE cases.


Custom Messages and stylesheets in SSRS for a specific user


Hi All,

   I have a question regarding the custom messages, custom colors on headers and footers of the SSRS reports to be changed as the user specifies changes accordingly on the reports and prints. Is this possible in SSRS. Please advice.

Secure messages via MSMQ queue when using local system and local user accounts


I am trying to send a message to a WCF service via a private MSMQ queue.  With security turned off, there's no problem.  With security turned on and using a normal user account (one registered with the Active Directory) to send messages, there's no problem.  However, if I use either the local system account or a local user account, it fails.

If I use a local user account it fails with the message:

Unhandled Exception: System.ServiceModel.MsmqException: An error occurred while sending to the queue: Unrecognized error -1072824272 (0xc00e0030).Ensure that MSMQ is installed and running. If you are sending to a local queue, ensure the queue exists with the required access mode and authorization.

If I use the local system account, no exception is thrown, but nothing is delivered to the service, and the queue remains empty.

Both "Everyone" and SYSTEM have permissions to "Get Properties", "Get Permissions" and "Send Message" as regards the private queue.

I am thinking there must be an issue with the queue failing to authenticate the users in the Active Directory, but given it's a private queue, I didn't think it would do that?

I seem to be having the same problems as a previous

User complains that disabled dropdownlist is hard to read


I have numerous dropdownlists that are disabled. they are light grey and the user claims that it is hard to read. How can I rectify this by making it darker or even a different color?

Coding / Programming Tips for C#

Using proper guidelines and a template-framed style of coding will really helps developer to enjoy the coding with more understandable, reliable code and application development.

MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

Choosing Between a User Control or Web Part for SharePoint

SharePoint will only display Web Parts on a page. However, there are publicly available shims that allow you to write user controls and have them be displayed as a Web Part. From SharePoint's point of view, the shim is a Web Part. From the point of view of the user control, the shim is simply a control in .NET that is including the user control

The void is invariant

while back I described a kind of variance that we've supported since C# 2.0. When assigning a method group to a delegate type, such that both the selected method and the delegate target agree that their return type is a reference type, then the conversion is allowed to be covariant. That is, you can say:

Best Coding Techniques To Improve Performance for SharePoint Applications

As more developers write custom code by using the SharePoint Object Model, they encounter common issues that can affect application performance.

The following areas reflect the main issues encountered by developers as they write custom code by using the SharePoint object model:

§ Disposing of SharePoint objects

§ Caching data and objects

§ Writing code that is scalable

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

How to track the changes of user contacts(colleagues) by using SharePoint API

We might have seen colleague tracker web part which keep tracks the changes made in our contacts/colleagues details like profile/lists/sites. The same tracking mechanism can be implemented by using MOSS API in any custom web part/ web control/ feature/web service...

UserProfile.GetColleagueChanges is the method which returns all changes happened with the contacts, this method also accepts a Query (UserProfileChangeQuery) where we can specify different parameters to filter the changes

Configuring User Profiles in SharePoint Server 2010

Note: I've added the necessary links relating to SharePoint Server 2010 prerequisites, along with instructions for configuring the user profile synchronization service, at the end of this

User Defined Functions in Microsoft SQL Server

User Defined Functions are compact pieces of Transact SQL code, which can accept parameters, and return either a value, or a table. They are saved as individual work units, and are created using standard SQL commands. Data transformation and reference value retrieval are common uses for functions. LEFT, the built in function for getting the left part of a string, and GETDATE, used for obtaining the current date and time, are two examples of function use. User Defined Functions enable the developer or DBA to create functions of their own, and save them inside SQL Server.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend