Click here to Skip to main content
15,920,383 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: rdlc page break Pin
C#Coudou8-Aug-10 19:17
C#Coudou8-Aug-10 19:17 
AnswerRe: rdlc page break Pin
Tej Aj8-Aug-10 21:26
Tej Aj8-Aug-10 21:26 
QuestionDropdownlist gridview Pin
C#Coudou8-Aug-10 16:24
C#Coudou8-Aug-10 16:24 
AnswerRe: Dropdownlist gridview Pin
Not Active8-Aug-10 17:10
mentorNot Active8-Aug-10 17:10 
GeneralRe: Dropdownlist gridview Pin
C#Coudou8-Aug-10 18:33
C#Coudou8-Aug-10 18:33 
AnswerRe: Dropdownlist gridview Pin
Arun Jacob8-Aug-10 20:06
Arun Jacob8-Aug-10 20:06 
GeneralRe: Dropdownlist gridview Pin
Not Active9-Aug-10 2:08
mentorNot Active9-Aug-10 2:08 
QuestionCalling Event in VB.nET Pin
yogesh_kumar_agarwal8-Aug-10 15:42
yogesh_kumar_agarwal8-Aug-10 15:42 
AnswerRe: Calling Event in VB.nET Pin
Not Active8-Aug-10 17:07
mentorNot Active8-Aug-10 17:07 
GeneralRe: Calling Event in VB.nET Pin
yogesh_kumar_agarwal8-Aug-10 19:24
yogesh_kumar_agarwal8-Aug-10 19:24 
AnswerRe: Calling Event in VB.nET Pin
Dave Doknjas9-Aug-10 12:40
Dave Doknjas9-Aug-10 12:40 
GeneralRe: Calling Event in VB.nET Pin
yogesh_kumar_agarwal10-Aug-10 21:17
yogesh_kumar_agarwal10-Aug-10 21:17 
GeneralRe: Calling Event in VB.nET Pin
Dave Doknjas11-Aug-10 4:56
Dave Doknjas11-Aug-10 4:56 
QuestionCount function Pin
yogesh_kumar_agarwal7-Aug-10 20:03
yogesh_kumar_agarwal7-Aug-10 20:03 
AnswerRe: Count function Pin
Estys7-Aug-10 21:06
Estys7-Aug-10 21:06 
QuestionValidation Pin
future38397-Aug-10 6:23
future38397-Aug-10 6:23 
Hi every1,
I know the approaches for validating data. I went through some articles regarding validating. I face with a problem when I implementing them.
if I use the following code there is no problem.easily I can raise the error.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.ComponentModel.DataAnnotations;

namespace MvcApplication1.Models
{
    public class GuestResponse
    {
        public string _email;

        [Required(ErrorMessage = "Please enter your email address")]
        [RegularExpression(".+\\@.+\\..+",
        ErrorMessage = "Please enter a valid email address")]
        public string Email
        {
            set { _email = value; }
            get { return _email; }
        }

         public GuestResponse()
        {
        }
        
        public GuestResponse(string email)
        {
            this._email = email;
        }       
    }
}


I am using another approach which is attribute and methods. when I defined a class through an exception I validate my data.but the problem is I cant show them on the screen. when the exception raise it goes to the line of exception while I wanna show the message on the screen.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.ComponentModel.DataAnnotations;

namespace MvcApplication1.Models
{
    public class GuestResponse
    {
        public string _name;

        public string Name
        {
            set 
            { 
               
                if (value == null)
                {
                    throw new ArgumentException(string.Format("Enter a value."));
                } else
                     _name = value;
            }

            get { return _name; }
        }

        public GuestResponse()
        {
        }
        
        public GuestResponse(string name, string email, string phone, Boolean attend)
        {
            this._name = name;

        }
   
    }
}



Could you please help me out how to fix this problem?
thanx in advance.
AnswerRe: Validation Pin
Sandeep Mewara7-Aug-10 7:12
mveSandeep Mewara7-Aug-10 7:12 
GeneralRe: Validation(Please help) Pin
future38397-Aug-10 10:17
future38397-Aug-10 10:17 
QuestionMasterPages and Flash menu Pin
Farraj7-Aug-10 5:31
Farraj7-Aug-10 5:31 
AnswerRe: MasterPages and Flash menu Pin
Not Active7-Aug-10 11:01
mentorNot Active7-Aug-10 11:01 
GeneralRe: MasterPages and Flash menu Pin
Farraj7-Aug-10 11:21
Farraj7-Aug-10 11:21 
GeneralRe: MasterPages and Flash menu Pin
Not Active7-Aug-10 11:30
mentorNot Active7-Aug-10 11:30 
GeneralRe: MasterPages and Flash menu Pin
Farraj7-Aug-10 12:05
Farraj7-Aug-10 12:05 
GeneralRe: MasterPages and Flash menu Pin
Not Active7-Aug-10 12:35
mentorNot Active7-Aug-10 12:35 
GeneralRe: MasterPages and Flash menu Pin
Farraj7-Aug-10 12:53
Farraj7-Aug-10 12:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.