If you are trying to return a variable from your Stored Procedure, then you must declare an output variable. A sample Procedure is shown below.
You can then get the variable in your aspx page accordingly. Dont forget to handle null.
CREATE PROCEDURE [dbo].[sample]
@output varchar OutPUT
SET NOCOUNT ON
IF @input = 1
SET @output ='your message'
If you were referring to print an error message from the SQL stored Proc , then use RAISEERROR function in your SQL Procedure.
use link http://msdn.microsoft.com/en-us/library/ms178592.aspx
You can then catch the exception in the aspx page and display it as required.