hello...
i have 2 webforms..1 view.aspx 2 detail.aspx
on view.aspx page i had put datagrid ..in datagrid when click on edit hyperlink the data of tht row
should go to detail.aspx page had different controls...
here query is how to do?...
here is my code...of design
1 view.aspx
<asp:DataGrid ID="Grid" runat="server" PageSize="4" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None" Width="730px" BorderWidth="1px" BorderColor="#DEDFDE" > <Columns> <asp:BoundColumn HeaderText="Code" DataField="ProductCode" SortExpression="Code">
asp:BoundColumn> <asp:BoundColumn HeaderText="Name" DataField="Name"> asp:BoundColumn> <asp:BoundColumn HeaderText="Description" DataField="Description"> asp:BoundColumn> <asp:TemplateColumn HeaderText="Detail"> <HeaderStyle Wrap="False">HeaderStyle> <ItemStyle HorizontalAlign="Center">ItemStyle> <ItemTemplate> <asp:HyperLink id="LnkDetail" runat="server" NavigateUrl="~/ProductDetail.aspx" Text="More">More..asp:HyperLink> ItemTemplate> asp:TemplateColumn>
<asp:TemplateColumn> <HeaderStyle Wrap="False" Width="50px">HeaderStyle> <ItemStyle Wrap="False" HorizontalAlign="Center">ItemStyle> <ItemTemplate> <asp:HyperLink id="LnkEdit" runat="server" NavigateUrl="~/ProductDetail.aspx" Text="Edit">Editasp:HyperLink> ItemTemplate> asp:TemplateColumn> <asp:TemplateColumn> <HeaderStyle Wrap="False" Width="50px">HeaderStyle> <ItemStyle Wrap="False" HorizontalAlign="Center">ItemStyle> <ItemTemplate> <asp:HyperLink id="LnkDelete" runat="server" NavigateUrl="~/ProductDetail.aspx" Text="Delete">Deleteasp:HyperLink> ItemTemplate> asp:TemplateColumn> Columns> <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <SelectedItemStyle BackColor="#EEF4FF" Font-Bold="True" ForeColor="Navy" /> <PagerStyle BackColor="#EEF4FF" ForeColor="Black" HorizontalAlign="Center" Mode="NumericPages" /> <AlternatingItemStyle BackColor="White" /> <ItemStyle BackColor="#EEF4FF" ForeColor="Black" Height="50px"/> <HeaderStyle BackColor="#DDEBFF" Font-Bold="True" ForeColor="Black" /> asp:DataGrid>
|
==================
2. detail.aspx
Product Code:<asp:TextBox ID="txtPrdCode" ValidationGroup="validators" runat="server" Width="150px" ontextchanged="txtPrdCode_TextChanged">asp:TextBox>
Description:<asp:TextBox ID="txtPrdDes" runat="server" TextMode="MultiLine" Width="255px" Height="116px">asp:TextBox>
|
plz help
Thanks in advance..
Kirtan PatelPosted Nov 5, 2009, 9:47 AM
[Problem Solved ] :)
Here is Corrected Project File With Delete/Update button
Click Here to Download
Modifications
---------------
+Changed The TableName Product to ProductData
+Replaced DataGrid With DataGridView Control
+Added code for performing tasks Delete /Update
dont forget to check Do you like this answer" check box please :) it helps me :)
kritikaPosted Nov 5, 2009, 10:24 AM
thanks a lot....
well my work using datagrid itself is going on...with add procedure...
nice frnd...
kritikaPosted Nov 5, 2009, 7:37 AM
well i will try to do as mentioned...
Thanks..
Amit ChoudharyPosted Nov 5, 2009, 7:15 AM
set its CommandArgument='<% Eval("ProductID")%>'
and write code in onclick event of LinkButton
Now recieve the parameters value at next page's cs file
by using following code
Enjoy Coding.....
======================================================
please mark the answer if it helps you :)
Kirtan PatelPosted Nov 5, 2009, 7:07 AM
mail Me the Download Link of Project Files after uploading it to http://mediafire.com
because i can better solve it practically on my laptop .I can not figure out how to do it by just reading the code :)