Sie Ste

Sie Ste

  • NA
  • 196
  • 184.4k

populate one cell in webform control

Nov 7 2011 12:20 PM
Problem: I want the "TextBoxOrgName.Text" of a detailview control to contain the organization name.

I am working on a C# asp.net 2010 webform application. In a detailview control I want to place the organization name  into the  cell called  "TextBoxOrgName.Text".  The problem is I  do not have the 'organization name' in the LinqDataSource1 listed below. I want setup a new linq data source to obtain the organization name value value listed below or place the value from a session variable here. Can you tell me how I could accomplish this goal?

  <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px"
        EnableModelValidation="True" GridLines="Both"
        AutoGenerateRows="False" DataSourceID="LinqDataSource1" BorderStyle="Solid"
         HorizontalAlign="Center">
         <Fields>
        
              <asp:TemplateField HeaderText="Organization Name" >
            
                 <ItemTemplate>
                      <asp:TextBox ID="TextBoxOrgName" runat="server" Text='' BorderStyle="None" ></asp:TextBox>
                   </ItemTemplate>
             </asp:TemplateField>
         </Fields>
     </asp:DetailsView>

Here are a few additional notes:

1. I know the best solution probably would be to bring in value in linqdataource1. However the organization name column is not part of the table that I want to update in the sql server 2008 r2 database. I am thinking linqdataource1 should only be the table I want updated from this particular webpage correct?

2. This is a data entry application and the user enters the organization name on the first webpage. The user clicks the next button from the first page and now we are on the second data entry page. I have the organization name available on the second page as a session varirable obtained from the first page

Answers (2)