C# control question

  • Thread starter Thread starter kilsoft
  • Start date Start date
K

kilsoft

I have created an control with my page content. How do I address a
table with a runat=server property in the content control from another
page hosting the control?

In the junk code below I need to change the InnerHtml of the content
table1.
<main page>
<header control />
<left navigation control />
<content control>
<table1 runat=server/>
<content control>

</main page>

Any help is appreciated. My apologies if this is a stupid newbie
question.
 
hi

you declare it as

HtmlGenericControl

in the aspnet group they can help you more with these kind of questions

cheers
 
You might try giving the html element an ID as well, creating a definition
for the control in code eg.
protected System.Web.UI.HtmlControls.HtmlTableCell myTablecell;

then make that variable accessable as a public property on your user control
 
I have it declared as an HtmlGenericControl

I'm trying to access the table from a different .cs file. How do I
address it in the code? The control page sees the table but the main
page that calls the control page cannot see the table, I get a The name
'table1' does not exist in the current context calling it from the top
page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top