如何在gridview中的项模板中获取多个值并将其传递给另一个页面 [英] how to get multiple value inside item template in gridview and pass it to another page

查看:73
本文介绍了如何在gridview中的项模板中获取多个值并将其传递给另一个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友



我的gridview中有一个项目模板,其中项目模板中有一个文本框..

in textbox some值正在显示但不是来自数据库它可以由用户动态更改





我的问题是如何获取由每行中的用户,并在另一页的另一个gridview中显示....



hi friends

there is a item template in my gridview where in item template there is a textbox..
in textbox some values are displaying but not from database it can be changed dynamicaly by the user


my question is how to get the values inserted by the user in each row and display in another gridview in another page....

<asp:GridView ID="GridView1" runat="server" ShowHeader="False" Width="577px" EmptyDataText="There is Nothing in your Gridview"
            AutoGenerateColumns="False" BackColor="White" BorderColor="White" BorderStyle="Ridge"
            BorderWidth="2px" CellPadding="5" CellSpacing="1" GridLines="None" 
            OnRowCommand="GridView1_RowCommand" DataKeyNames="ProductId" 
            onselectedindexchanging="GridView1_SelectedIndexChanging">
            <rowstyle backcolor="#DEDFDE" forecolor="Black" cssclass="gg" />
            <columns>
               
                <asp:BoundField DataField="ProductName" SortExpression="ProductName" />
                <asp:BoundField DataField="ProductLogDesc" SortExpression="ProductLogDesc" />
                <asp:BoundField DataField="ProductCost" SortExpression="ProductCost" />
              
                <asp:TemplateField>
                    <itemtemplate>
                        <asp:TextBox ID="txtQuantity" Columns="5" Text='<%# Eval("Quantity") %>' runat="server">
                        <asp:LinkButton runat="server" ID="btnRemove" Text="Remove" CommandName="Remove"
                            CommandArgument='<%# Eval("ProductId") %>' Style="font-size: 12px;">
                    </itemtemplate>
                
            </columns>
            <footerstyle backcolor="#C6C3C6" forecolor="Black" />
            <pagerstyle backcolor="#C6C3C6" forecolor="Black" horizontalalign="Right" />
            <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />

推荐答案

动态构建项目模板

或者



从java脚本中读取文本框值和id并将其保存为隐藏字段,然后导航到所需页面
Build the Item Template dynamically
or

Read the text box values and id from java-script and save it hidden fields then navigate to required page


这篇关于如何在gridview中的项模板中获取多个值并将其传递给另一个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆