Hi
Greetings from Devipriyanka.
I have created a repeater with 3 template like shown below:
<asp:Repeater runat="server" OnItemDataBound="repeaterSearchResult_ItemDataBound" ID="repeaterSearchResult">
<ItemTemplate>
<asp:TextBox ID="textBoxSearch" runat="server" Text="<%#Container.DataItem%>"></asp:TextBox>
<asp:Button ID="buttonAdd" runat="server" Text="Button" OnClick="button_click"/>
<asp:GridView ID="gridView" runat="server">
<%--And the Columns goes here--%>
</asp:GridView>
</ItemTemplate>
</asp:Repeater>
And this is how i bind the repeater:
private void LoadControls(string Flag)
{
LocationName.Clear();
string htext = "";
Updatesearch.Update();
dynamicTextBoxes = new TextBox[Convert.ToInt32(Session["Count"])];
dynamicButtons = new Button[Convert.ToInt32(Session["Count"])];
dynamicGV = new GridView[Convert.ToInt32(Session["Count"])];
int i;
if (Flag == "L")
{
htext = "PortOfDischargeName";
sql = "Select " + htext + " from VW_TransAIHBLMasterUpdateDetails where tBLG_NUIsActive=1 and PortOfLoadName='" + Session["Loading"].ToString() + "' group by PortOfDischargeName";
}
else if (Flag == "D")
{
htext = "PortOfLoadName";
sql = "Select " + htext + " from VW_TransAIHBLMasterUpdateDetails where tBLG_NUIsActive=1 and PortOfDischargeName='" + Session["Destination"].ToString() + "' group by PortOfLoadName";
}
else
{
sql = "";
}
SqlDataReader rdr = mobjGenlib.objDBLib.ExecuteQueryReader(sql.ToString());
while (rdr.Read())
{
LocationName.Add(rdr.GetValue(0).ToString());
}
rdr.Close();
repeaterSearchResult.DataSource = LocationName;
repeaterSearchResult.DataBind();
}
Based on my code the textbox will be generate.
for eg: my code returns 3 then 3 textbox will be created.
My gridview will bind based on the value in the textbox.
now what i need is i want to know how to read the third textbox value.
can any one please help me to solve this...
Thanks in adcance