kritika

kritika

  • NA
  • 53
  • 0

DataGrid with edit,delete link..open in new page.....

Nov 5 2009 7:02 AM

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">Edit</asp: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">Delete</asp: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..
 

Answers (5)