.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Accessing data in a dymaic form control.

Posted By:      Posted Date: September 04, 2010    Points: 0   Category :ASP.Net
I have a page that will generate upto 10 copies of some web controlls, depending on how many the user wants, but I am not sure on how to access the data the user enters into it. The code  I have is: protected void ddlAmountToAdd_SelectedIndexChanged(object sender, EventArgs e) { //Create a for loop to generate and add all the form fields then add them to the pannel for (byte i = 2; i <= Convert.ToByte(ddlAmountToAdd.SelectedValue); i++) { Label lblGameName = DynamicControlCreator.Label("lblGameName" + i, "Game Name: "); TextBox tbGameName = DynamicControlCreator.TextBox("tbGameName" + i); Label lblReleaseDate = DynamicControlCreator.Label("lblReleaseDate" + i, " Release Date (MM/DD/YYYY): "); TextBox tbReleaseDate = DynamicControlCreator.TextBox("tbReleaseDate" + i); Label lblRegion = DynamicControlCreator.Label("lblRegion" + i, " Region: "); DropDownList ddlRegion = DynamicControlCreator.DropDownList("ddlRegion" + i, Regions); Label lblRegionOther = DynamicControlCreator.Label("lblOtherRegion" + i, " Other: "); TextBox tbRegionOther = DynamicControlCreator.TextBox("tbOtherRegion" + i); Labe

View Complete Post

More Related Resource Links

accessing form view binded control from child control

I am using a form view control which has two binded textbox. Now at this level it works fine and the textboxes show the values from database. But when i insert a panel inside the form view and move these two textboxes inside the panel, they dont show any values. What could be the reason for this? Thanks!

Accessing the selected value of a dropdownlist control in a Form View


I need to verify the selection in a dropdown list control is not a certain value.  It is in the edit mode of a formview.

just to verify that I could access it I tried to put the value in a label,  however it is always empty:


this is what I used

  'Dim droplist5 As DropDownList = DirectCast(FormView1.Row.FindControl("DropDownList5"), DropDownList)


            LabelHeaderwarning.Text = droplist5.SelectedValue.ToString


I also tried the validation controls but they don't seem to work with a drop down control.


Any suggestions on this would be extremely helpful



Solution to controlling the Redirect URL after saving content in a Data Form View Control



I have customized a Page Layout to include a custom Data Form View Web Part that will allow users to enter comments on a news story page in a publishing site.


I was having a difficult time because when I clicked the button to save the data to the list, everything saved correctly, but the control was redirecting me to the AllItems.aspx page of the list.  This wasn't the desired behavior since the end user would prefer to see that their comment was posted on the news story page and wouldn't know what the AllItems.aspx page was for.


The save button that was created in the XSL seciton of the web part was:


<SharePoint: SaveButton runat="server" ControlMode="New" id="savebutton1" />


Microsoft has documented a RedirectUrl property on this button that I figured could change what page was loaded after the user saved the form data.  However, try as I might I could not get it to work.


Some more searching lead me to this article:


Accessing data in infopath form from another database


Hi, I am having Sharepoint 2010 RTM Enterprise Trial on Windows Server 2008 SP2.

can it be possible to retrieve data from another database (not a sharepoint databse) and populate infopath form with it ?

if yes, please provide any links so that i can start from there....

if no, please provide any alternate solutions...


Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

GridView control to show master-child or master-slave data, written in c#, asp.net

I previously made a master slave datagrid using Visual Studio 2003 .Net (original article) that would allow users to show data to clients using collapse and expand features. These features however did not carry over to gridview for many users. This tutorial will explaing how to create a collapsable/expandable gridview in frameworks 2.0 and higher

Easily manipulate data with the GridView control in ASP.NET 2.0

Last week, I introduced ASP.NET 2.0's GridView data control and covered the basics of using it. This week, I go a step further by going into the details of working with the data contained in the control. This includes viewing, editing, and deleting data. Thankfully, the GridView control makes it easy to utilize these features. Before diving into these topics, I begin with an examination of the different field types supported by the GridView control.

Accessing SharePoint 2010 Data with Server-Side APIs

Accessing SharePoint data in server-side solutions is one of the most common tasks that you will perform as a SharePoint developer. SharePoint 2010 provides powerful server-side APIs that enable you to retrieve, add, edit, and delete SharePoint data programmatically. SharePoint 2010 also includes the new LINQ to SharePoint technology that enables you to work with SharePoint data efficiently and easily.

Sorting Data in a GridView Web Server Control

The GridView control provides built-in sorting functionality without requiring any coding. You can further customize the sort functionality of the GridView control by using custom SortExpression property values for columns as well as by using the Sorting and Sorted events

Persist data in a dynamically populated ListBox in a user control


Hi All,

I am trying to persist data in a dynamically populated ListBox in a user control. Here are the details

I have a user control which contains a a listBox and button. On Page_Load of user control I am populating the ListBox control with some values. On Click of button, I am trying to fetch the values which I have selected in ListBox. Though this seems very simple and straight forward I am unable to fetch values.

My Page_Load Function

void Page_Load(object sender, EventArgs e)










My Click Function

Protected Void Button1_Click(object sender, EventArgs e)


       string strValue = listBox.SelectedValue



I have placed brake point at Page_Load and on click function, I am seeing that the moment the breakpoin

Office Add-Ins: 3 Solutions for Accessing SharePoint Data in Office 2010


SharePoint 2010 introduces a number of new ways to access business data and present it to the user. We'll show you several options that range from no-code solutions to fully integrated Office add-ins.

Donovan Follette , Paul Stubbs

MSDN Magazine July 2010

Form Filler: Build Workflows to Capture Data and Create Documents


Learn how to create a workflow that uses InfoPath forms and other office documents for passing data to targeted activities and for use in Office documents.

Rick Spiewak

MSDN Magazine June 2008

Extreme ASP.NET: The Only Data-binding Control You'll Ever Need


Fritz Onion demonstrates how the ListView control in ASP.NET 3.5 makes data-binding tasks easier with support for styling with CSS, flexible pagination, and a full complement of sorting, inserting, deleting, and updating features.

Fritz Onion

MSDN Magazine March 2008

Data Points: Accessing Data from a Mobile Application


This month John Papa takes a look at developing a mobile application that can access data on your application server.

John Papa

MSDN Magazine January 2008

Extend ASP.NET: Simplify Data Binding In ASP.NET 2.0 With Our Custom Control


The wwDataBinder control addresses simple control data binding--binding simple form controls like textboxes, checkboxes, and the selected values of list controls to individual data or object values.

Rick Strahl

MSDN Magazine December 2006

Cutting Edge: Custom Data Control Fields


In ASP. NET 2. 0, the GridView and DetailsView controls are designed to work together. They don't merely provide complementary services, they also share a number of helper classes and components. The output of the GridView control consists of a sequence of rows, each with a fixed number of columns.

Dino Esposito

MSDN Magazine January 2006

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend