Introduce DataBase,Asp.net,JavaScript,Xml,Html,Css,Sql,Php,ASP.NET Controls,AJAX,Tools,HTML,CSS,JavaScript,Open Source Project,WPF,.Net Framework,Linq
Top Recommended Hosting

using variable in .ascx in .aspx

by the3factory 5/6/2008 8:22:00 AM
Question:

I've got meta.ascx which gets info from a database and puts it into a variable called keywords. In meta.ascx I declared the variable as public.  But in the .aspx I can't use <%=keywords%> as I'm getting an error System.Data.Keywords' is not accessible in this context because it is 'Private'.

 

How do I make a variable in the ascx and still use it in the aspx?

 

 


Answer1:

Something is unclear is this ascx being used in your aspx?

Also, why dont you declare keywords variable as protected in your aspx.


Answer2:

Hi,

use this

<% = WebUserControl1.intTest  %>


Tags:

Related posts

Sign up for PayPal and start accepting credit card payments instantly.


Powered by BlogEngine.NET 1.2.0.0