Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 472999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:08:34+00:00 2026-05-13T00:08:34+00:00

I have a bit of a problem I was wondering if you could help

  • 0

I have a bit of a problem I was wondering if you could help me.

I have the following little bit of code:

protected void btnSubmit_Click(object sender, EventArgs e)
{
    Page.Validate("RadMaterial");
    Page.Validate("TopX");

    int max = 0;

    if (int.TryParse(txtbxHowMany.Text, out max))
    {    
        GridView1.DataSource = this.GetMaterialData("123456",radTopx.SelectedItem.Value, "Primary", max);
        GridView1.DataBind();
    }
} 

I have a couple of validation groups set up the first – if the click is made and the txtbxHowMany is not populated, a simple error is shown.

I also set up a validation group for the radiobutton list so that, should the user hit submit without checking a radiobutton, the required field validation should fire.

However, it is not firing. I am getting a “NullReferenceException was handled by user code.”

My thinking is that because the radTopx.SelectedItem.Value is, well, null.

How would I go about getting around this little issue of mine? Again, apologies for what is most likely a ridiculously easy question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T00:08:34+00:00Added an answer on May 13, 2026 at 12:08 am

    Interesting the way you used Validate method.

    See what msdn says about it.

    http://msdn.microsoft.com/en-us/library/dwzxc386.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bit of a problem that I can't seem to code my
I have a bit of a problem. I am trying to do the following
I have a bit of problem when trying to validate my page as HTML5.
I have a bit of a problem building my project. I'm getting the bellow
I have a bit of a problem here. I have a third party ActiveX
So, I have a bit of a problem. I'm trying to convert an array
I'm quite new to MediaWiki, and now I have a bit of a problem.
I have a bit of a strange problem. I have a music app that
I have a bit of a unique problem with an upcoming project; I need
I have a bit of a unique problem. I am registering a dll as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.