coldchillin
asked on
Displaying a variable
I simple do not know how to display a variable on a page. The DAL approach I am using is code-behind TableAdapters.
I know how to use a TableAdapter and bind that to a repeater, table, etc. but I want to display a variable, possibly in a label, without using Design Mode, and without inline coding any sql statements.
Is it possible to accomplish this using the TableAdapter method, and do I have to assign some object the variable, or can I just display it in the presentation layer?
I know how to use a TableAdapter and bind that to a repeater, table, etc. but I want to display a variable, possibly in a label, without using Design Mode, and without inline coding any sql statements.
Is it possible to accomplish this using the TableAdapter method, and do I have to assign some object the variable, or can I just display it in the presentation layer?
ASKER
Using the tableadapter method, I have the following, which I am not able to make work:
azjobsiteTableAdapters.see kerProfile TableAdapt er seeker = new azjobsiteTableAdapters.see kerProfile TableAdapt er();
Label1.Text = seeker.GetResumeViews(Conv ert.ToInt3 2(Session[ "rUserID"] ));
My presentation layers looks like this:
<asp:Label ID="Label1" runat="server" Text="<%# DataBinder.Eval(Container. DataItem, "datePosted") %>"></asp:Label>
The error I get is that the server tag is not well formed.
azjobsiteTableAdapters.see
Label1.Text = seeker.GetResumeViews(Conv
My presentation layers looks like this:
<asp:Label ID="Label1" runat="server" Text="<%# DataBinder.Eval(Container.
The error I get is that the server tag is not well formed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In the code behind (somewhere in the Page_Load):
string variableToDisplay = "I want this on the web page";
label1.Text = variableToDisplay;
In the aspx:
<asp:label id="label1" runat="server" Text="" />
Does that answer your question??