TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sie Ste
NA
196
184.5k
obtain data for asp.net web forms
Nov 4 2011 8:53 PM
I am wrting a few new web forms in C#asp.net 2010 and I am working with a formview and detailview controls. I have changed some columns to template fields and now I am working with them. What I would like to know if I can take a session variable and/or a local variable and place it in the location in the item template where the database column is obtained from?
The following is an example:
<asp:TemplateField HeaderText="Organization Name" >
<ItemTemplate>
<asp:TextBox ID="TextBoxOrgName" runat="server" Text='<%# eVAL(Session["CompanyName") %>'>' ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
Basically is there a way to replace '<%# eVAL(Session["CompanyName") %>'>' with a value that would have been obtained from the database? If so, how would you code this? if not, what is your suggestion besides forcing a database column to have this data just to show the value on a web form page?
Reply
Answers (
2
)
buttons on asp.net controls
Thread and Process