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 925677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:33:31+00:00 2026-05-15T19:33:31+00:00

I created a user control in Asp.Net which I populate with <asp:Table id =

  • 0

I created a user control in Asp.Net which I populate with <asp:Table id = "...." />
this table has columns that contain dropdownlists, textfields and other web controls…

In the code behind I am not able to access these web controls, is there a way I can access them…….or I shouldn’t be doing that in the code behind of the user control???

here is my ascx code markup:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MarriageControl.ascx.cs" %>
<%@ Register assembly="BasicFrame.WebControls.BasicDatePicker" namespace="BasicFrame.WebControls" tagprefix="BDP" %>

  <asp:TextBox ID = test runat = "server" />

  <asp:Table ID = "marriageInfoTable" runat = "server" Caption="معلومات الزواج" 
    CellPadding="2" CellSpacing="2" Width="979px" Height="164px">
    <asp:TableRow runat="server">
        <asp:TableHeaderCell runat = "server" Text = " " />
        <asp:TableHeaderCell runat = "server" ID = "husbandHeader"  Text = "الزوج" HorizontalAlign = "Right" />
        <asp:TableHeaderCell runat = "server" ID = "wifeHeader" Text = "الزوجة" HorizontalAlign = "Right" />
    </asp:TableRow>
    <asp:TableRow runat="server">
        <asp:TableCell runat = "server" Text ="الاسم الرباعي" />
        <asp:TableCell runat = "server">
            <asp:TextBox runat ="server" ID = "fullNameHusbandTextBox"  Height = "30px" Width = "250px" Font-Bold = "true" Font-Size = "20px"/>
        </asp:TableCell>
        <asp:TableCell runat = "server">
            <asp:TextBox runat ="server" ID = "fullNameWifeTextBox"  Height = "30px" Width = "250px"  Font-Bold = "true" Font-Size = "20px"/>
        </asp:TableCell>
    </asp:TableRow>
    <asp:TableRow runat="server">
        <asp:TableCell ID="dateOfBirthCell" runat = "server" Text ="تاريخ الميلاد" />
        <asp:TableCell  runat = "server">
            <BDP:BasicDatePicker ID="dateOfBirth_husband" runat="server" DateFormat = "yyyy/MM/dd" />
        </asp:TableCell>
        <asp:TableCell ID="TableCell3" runat = "server">
            <BDP:BasicDatePicker ID="dateOfBirth_wife" runat="server"  DateFormat = "yyyy/MM/dd"/>
        </asp:TableCell>
    </asp:TableRow>
    <asp:TableRow runat="server">
        <asp:TableCell runat = "server" Text = "مكان الإقامة" />
        <asp:TableCell runat = "server">
            <asp:DropDownList runat = "server" ID = "residenceHusbandPickList" />
        </asp:TableCell>
        <asp:TableCell runat = "server">
            <asp:DropDownList runat = "server" ID = "residenceWifePickList" />
        </asp:TableCell>
    </asp:TableRow>
    <asp:TableRow runat="server">
        <asp:TableCell runat = "server" Text = "اسم و شهرة الأب والأم"/>
        <asp:TableCell runat = "server">
            <asp:Table runat = "server" ID = "nameOfFatherMother_Husband">
                <asp:TableRow runat = "server">
                    <asp:TableCell runat = "server">
                    <asp:Label runat = "server" Text = "اسم الأب الرباعي" />
                    </asp:TableCell>
                    <asp:TableCell runat = "server">
                    <asp:TextBox runat = "server" id = "nameOfFather_Husband" Width = "200px" Font-Bold = "true" Font-Size = "20px" /> 
                    </asp:TableCell> 
                </asp:TableRow>
                <asp:TableRow runat = "server">
                    <asp:TableCell runat = "server">
                        <asp:Label ID="Label1" runat = "server" Text = "اسم الأم الرباعي"  />
                    </asp:TableCell>
                    <asp:TableCell runat = "server">
                        <asp:TextBox runat = "server" id = "nameOfMother_Husband" Width = "200px" Font-Bold = "true" Font-Size = "20px" />
                    </asp:TableCell>
                </asp:TableRow>
            </asp:Table>
        </asp:TableCell>
        <asp:TableCell runat = "server">
            <asp:Table runat = "server" ID = "Table1">
                <asp:TableRow ID="TableRow1" runat = "server">
                    <asp:TableCell ID="TableCell1" runat = "server">
                    <asp:Label ID="Label2" runat = "server" Text = "اسم الأب الرباعي" />
                    </asp:TableCell>
                    <asp:TableCell ID="TableCell2" runat = "server">
                    <asp:TextBox runat = "server" id = "nameOfFather_Wife" Width = "200px" Font-Bold = "true" Font-Size = "20px" /> 
                    </asp:TableCell> 
                </asp:TableRow>
                <asp:TableRow ID="TableRow2" runat = "server">
                    <asp:TableCell ID="TableCell4" runat = "server">
                        <asp:Label ID="Label3" runat = "server" Text = "اسم الأم الرباعي"  />
                    </asp:TableCell>
                    <asp:TableCell ID="TableCell5" runat = "server">
                        <asp:TextBox runat = "server" id = "nameOfMother_Wife" Width = "200px" Font-Bold = "true" Font-Size = "20px" />
                    </asp:TableCell>
                </asp:TableRow>
            </asp:Table>                
        </asp:TableCell>
    </asp:TableRow>
    <asp:TableRow runat="server">
        <asp:TableCell runat = "server">
            <asp:Label runat = "server" Text = "مكان إقامة الأب والأم"></asp:Label>
        </asp:TableCell>
        <asp:TableCell runat = "server">
            <asp:Table runat = "server">
                <asp:TableRow runat = "server">
                    <asp:TableCell runat = "server">
                        <asp:Label runat="server" Text = "مكان سكن الأب" ></asp:Label>
                    </asp:TableCell>
                    <asp:TableCell runat = "server">
                        <asp:DropDownList ID = "residenceOfFather_Husband" runat = "server"></asp:DropDownList>
                    </asp:TableCell>
                </asp:TableRow> 
                <asp:TableRow runat = "server">
                    <asp:TableCell ID="TableCell6" runat = "server">
                        <asp:Label ID="Label4" runat="server" Text = "مكان سكن الأم" ></asp:Label>
                    </asp:TableCell>
                    <asp:TableCell ID="TableCell7" runat = "server">
                        <asp:DropDownList ID = "residenceOfMother_Husband" runat = "server"></asp:DropDownList>
                    </asp:TableCell>
                </asp:TableRow>               

            </asp:Table>                   
        </asp:TableCell>
        <asp:TableCell ID="TableCell8" runat = "server">
            <asp:Table ID="Table2" runat = "server">
                <asp:TableRow ID="TableRow3" runat = "server">
                    <asp:TableCell ID="TableCell9" runat = "server">
                        <asp:Label ID="Label5" runat="server" Text = "مكان سكن الأب" ></asp:Label>
                    </asp:TableCell>
                    <asp:TableCell ID="TableCell10" runat = "server">
                        <asp:DropDownList ID = "residenceOfFather_Wife" runat = "server"></asp:DropDownList>
                    </asp:TableCell>
                </asp:TableRow> 
                <asp:TableRow ID="TableRow4" runat = "server">
                    <asp:TableCell ID="TableCell11" runat = "server">
                        <asp:Label ID="Label6" runat="server" Text = "مكان سكن الأم" ></asp:Label>
                    </asp:TableCell>
                    <asp:TableCell ID="TableCell12" runat = "server">
                        <asp:DropDownList ID = "residenceOfMother_Wife" runat = "server"></asp:DropDownList>
                    </asp:TableCell>
                </asp:TableRow>               

            </asp:Table>                   
        </asp:TableCell>                
    </asp:TableRow>
    <asp:TableRow runat="server">
        <asp:TableCell runat = "server">
            <asp:Label runat = "server" ID = "nameOfWitnesses" Text =  "أسماء الشهود" />
        </asp:TableCell>
        <asp:TableCell ID="tblCellWitnesses_Husband" runat = "server">
            <asp:Table runat = "server">
                <asp:TableRow runat = "server">
                    <asp:TableCell runat = "server">
                        <asp:TextBox ID = "witnessName" runat = "server" Width = "250px" />
                        <asp:Button ID = "addWitness" runat = "server" Text = "أضف شاهد" />
                    </asp:TableCell>
                </asp:TableRow>                        
            </asp:Table>
        </asp:TableCell>
        <asp:TableCell ID="tblCellWitnesses_Wife" runat = "server">
            <asp:TextBox ID = "TextBox1" runat = "server" Width = "250px" />
            <asp:Button ID = "addWitness2" runat = "server" Text = "أضف شاهد"  />
        </asp:TableCell>
    </asp:TableRow>            
</asp:Table>

in my code behind (ascx.cs) i am trying to fill the dropdown with data … I just can’t
type the id of anything I have and use it.

protected void Page_Load(object sender, EventArgs e)
{
  if (!IsPostBack)
  {
      //appropriate connection start
      dataBaseConnection = new SqlConnection();
      dataBaseConnection.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\ChurchApp\ChurchApplication\App_Data\Database.mdf;Integrated Security=True;User Instance=True";
      dataAdapter = new SqlDataAdapter("SELECT * FROM Country");
      ds = new DataSet();
      dataAdapter.Fill(ds, "CountryTable");

    }
  • 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-15T19:33:31+00:00Added an answer on May 15, 2026 at 7:33 pm

    I have figured out the problem by checking every single line.

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MarriageControl.ascx.cs" %>
    

    The problem is in this line I was missing the inherits attribute

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

Sidebar

Related Questions

I've created a regular ASP.NET user control, including the ascx file. For example: MyUserControl.ascx
I've created a user control (in vb.net code) that contains two dock panels, one
I've created a simple user control which is manually created with something like MyUserControl
How do I raise an event from a user control that was created dynamically?
I have created a user control to handle adding comments to certain business entities,
I created an Interop user control in VS2005. When the user control is shown
I created a custom autocomplete control, when the user press a key it queries
I'm trying to create a user control that allows users to make something like
I know how to create a custom user control in WPF but how can
I am trying to create a winForms user control. But I want would like

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.