Click here to Skip to main content
15,893,401 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Regular expression in asp.net Pin
OriginalGriff16-Nov-09 21:32
mveOriginalGriff16-Nov-09 21:32 
GeneralRe: Regular expression in asp.net Pin
Pankaj Saha16-Nov-09 23:31
Pankaj Saha16-Nov-09 23:31 
QuestionHow to get Hardware Information of Client PC? Pin
asfak.ur.rahman16-Nov-09 18:27
asfak.ur.rahman16-Nov-09 18:27 
AnswerRe: How to get Hardware Information of Client PC? Pin
Abhijit Jana16-Nov-09 18:54
professionalAbhijit Jana16-Nov-09 18:54 
GeneralRe: How to get Hardware Information of Client PC? Pin
asfak.ur.rahman17-Nov-09 14:14
asfak.ur.rahman17-Nov-09 14:14 
AnswerRe: How to get Hardware Information of Client PC? Pin
Abhishek Sur16-Nov-09 21:16
professionalAbhishek Sur16-Nov-09 21:16 
QuestionConverting date time to Thai calendar month Pin
meeram39516-Nov-09 18:00
meeram39516-Nov-09 18:00 
Questionsetting value of a control in ascx via aspx [modified] Pin
uglyeyes16-Nov-09 13:55
uglyeyes16-Nov-09 13:55 
Hi!

I have two public property in ascx. for the first time when the pageloads it works fine. but next time when I try to update the value of label control in ascx via aspx it says object ref not set to instance...
my codes

.ascx

 public string CountryName
        {
            get { return lblCountry.Text; }
            set 
            {
                if (!(value == ""))
                    lblCountry.Text = value;
                else
                    lblCountry.Text = "All Country";
            }
        }

        public string AdType
        {
            get { return lblAdType.Text; }
            set 
            {
                if (!(value == ""))
                    lblAdType.Text = value;
                else
                    lblAdType.Text = "All Ads";
            }
        }
.aspx
------
   public string AdType
        {
            get { return _AdType; }
            set { _AdType = value; }
        }
if (!Page.IsPostBack)
{
  if (!(Request.QueryString["q"] == null))
                {
                    Session["AdType"] = Request.QueryString["q"];
                }
 if (Session["AdType"] != null)
                {
                    AdType = Session["AdType"].ToString();
                    ddAdType.SelectedIndex = ddAdType.Items.IndexOf(ddAdType.Items.FindByText(AdType));
                }

  this.Left.AdType = ddAdType.SelectedItem.Text; <-- Left is a ascx here. and null ref exception is thrown at this line.
                this.Left.CountryName = CountryName;
            }

by default the adtype and countryname is empty so Left.ascx displays "All Country" and "All Ads". now when I click one of the link on Left.ascx that redirects to my .aspx?q=xyz

modified on Monday, November 16, 2009 8:10 PM

AnswerRe: setting value of a control in ascx via aspx Pin
Christian Graus16-Nov-09 14:00
protectorChristian Graus16-Nov-09 14:00 
GeneralRe: setting value of a control in ascx via aspx Pin
uglyeyes16-Nov-09 14:12
uglyeyes16-Nov-09 14:12 
GeneralRe: setting value of a control in ascx via aspx Pin
Christian Graus16-Nov-09 14:20
protectorChristian Graus16-Nov-09 14:20 
GeneralRe: setting value of a control in ascx via aspx Pin
uglyeyes16-Nov-09 14:25
uglyeyes16-Nov-09 14:25 
GeneralRe: setting value of a control in ascx via aspx Pin
Christian Graus16-Nov-09 14:27
protectorChristian Graus16-Nov-09 14:27 
GeneralRe: setting value of a control in ascx via aspx Pin
uglyeyes16-Nov-09 14:54
uglyeyes16-Nov-09 14:54 
GeneralRe: setting value of a control in ascx via aspx Pin
Christian Graus16-Nov-09 14:59
protectorChristian Graus16-Nov-09 14:59 
GeneralRe: setting value of a control in ascx via aspx Pin
uglyeyes16-Nov-09 15:06
uglyeyes16-Nov-09 15:06 
GeneralRe: setting value of a control in ascx via aspx [modified] Pin
uglyeyes16-Nov-09 15:14
uglyeyes16-Nov-09 15:14 
GeneralRe: setting value of a control in ascx via aspx Pin
uglyeyes16-Nov-09 16:48
uglyeyes16-Nov-09 16:48 
QuestionWorking with Themes Pin
FJJCENTU16-Nov-09 12:19
FJJCENTU16-Nov-09 12:19 
AnswerRe: Working with Themes Pin
AlexeiXX316-Nov-09 13:45
AlexeiXX316-Nov-09 13:45 
AnswerRe: Working with Themes Pin
sashidhar16-Nov-09 17:53
sashidhar16-Nov-09 17:53 
Questionpost back issue Pin
Tauseef A16-Nov-09 10:45
Tauseef A16-Nov-09 10:45 
AnswerRe: post back issue Pin
Christian Graus16-Nov-09 11:09
protectorChristian Graus16-Nov-09 11:09 
QuestionRe: post back issue Pin
Tauseef A16-Nov-09 23:30
Tauseef A16-Nov-09 23:30 
QuestionChanging ConnectionString Pin
sparlay_pk16-Nov-09 6:09
sparlay_pk16-Nov-09 6:09 

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.