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
Faisal Ansari
NA
451
834.6k
How can we get text box value which is built in gridview
Jul 4 2011 6:18 AM
hello guys how r u ?
Q: my Question is that , how can i get the value of text box which i built in gridview through the item template field?
i was try like this but i did not get the value
<asp:GridView ID="GridView1" runat="server" BackColor="#CCCCCC"
BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4"
CellSpacing="2" ForeColor="Black" ShowFooter="True">
<RowStyle BackColor="White" />
<Columns>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
CommandName="Select" Text="Select"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Answer">
<FooterTemplate>
<asp:LinkButton ID="lbnSubmit" runat="server" onclick="lbnSubmit_Click">Submit</asp:LinkButton>
</FooterTemplate>
<ItemTemplate >
<asp:TextBox ID="txtAnswer" runat="server">Answer</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
</asp:GridView>
string data;
protected void lbnSubmit_Click(object sender, EventArgs e)
{
foreach (GridViewRow gvr in GridView1.Rows)
{
data = gvr.Cells[1].Text;
}
Response.Write(data);
}
reply soon please its urgent...
Reply
Answers (
2
)
ckeditor
How to change font color of Message body