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
Java Copy
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
Java Copy
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 PatelRank #292 · 8.6K reputationPosted Nov 5, 2009, 4:47 AM EST
[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 :)
Kirtan PatelRank #292 · 8.6K reputationPosted Nov 5, 2009, 2:07 AM EST
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 :)
Amit ChoudharyRank #145 · 15.8K reputationPosted Nov 5, 2009, 2:15 AM EST
set its CommandArgument='<% Eval("ProductID")%>'
and write code in onclick event of LinkButton
Now recieve the parameters value at next page's cs file
protected void Page_Load(object sender, EventArgs e) { int pid = Convert.ToInt32(Request.QueryString["id"]); // Now write your Databse query for Description here and do editing }Enjoy Coding.....
======================================================
please mark the answer if it helps you :)
kritika49 reputationPosted Nov 5, 2009, 2:37 AM EST
well i will try to do as mentioned...
Thanks..
kritika49 reputationPosted Nov 5, 2009, 5:24 AM EST
thanks a lot....
well my work using datagrid itself is going on...with add procedure...
nice frnd...