AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 passing gridview footer texbox from child form
Posted by Rolando Puno on  1/31/2011 6:36:16 PM Category: Asp.Net 2.0
Add to my favorites
Email to friend
Hi,

Good Day..I have a little problem on passing value to gridview textbox, here's my code:


-----------------Parent Form---------------

<asp:TemplateField HeaderText="Account">
<EditItemTemplate>
<asp:TextBox ID="txtChartAccount" runat="server" Text='<%# Eval("ChartAccount") %>' Width="80px"></asp:TextBox>
</EditItemTemplate>

<FooterTemplate>
<asp:TextBox ID="txtNewChartAccount" runat="server" Width="100px"></asp:TextBox>
</FooterTemplate>

<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("ChartAccount") %>' Width="100px"></asp:Label>
</ItemTemplate>
</asp:TemplateField>

----------------------------------------Child Form--------------------------------
<script type="text/javascript">

function GetRowValue(val) {
window.opener.document.getElementById("txtNewChartAccount").value = val.toString();
self.close();
window.close();
}
</script>


Questions:


1. i cant pass the value here: gridview footer template
<FooterTemplate>
<asp:TextBox ID="txtNewChartAccount" runat="server" Width="100px"></asp:TextBox>
</FooterTemplate>


2. i cant also pass the value here: EditItemTemplate
<EditItemTemplate>
<asp:TextBox ID="txtChartAccount" runat="server" Text='<%# Eval("ChartAccount") %>' Width="80px"></asp:TextBox>
</EditItemTemplate>


is it passible to pass the value in footer template?

please give the idea on this..

Thanks

Advance happy Valentitnes day

Post Your Reply Post New Question

 Viewer's Reply
Passing Value to GridView Footer control from JavaScript
Answered By Moderator1 on 2/15/2011 8:26:58 AM
Hi,

I understand that you are trying to pass value from the child page to the parent's page GridView's Footer's control.. This is not possible with JavaScript.. because the JavaScript you have written does not able to identify the control at runtime.

Try to do with code-behind.
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
No Nonsense XML Web Development With PHP - Free 146 Page Preview!
When Good HTML Goes Bad: How You Can Protect Your Web Applications