G
Guest
hi all,
I am a newbie and i need some help.I have datagrid on my asp.net page
which has hyperlink columns.
the datagrid configuration in the aspx page is as follows
<aspataGrid id="dgNewsLinks" DataKeyField="News_ID" runat="server"
Width="283px" AutoGenerateColumns="False" GridLines="None" ShowHeader="False">
<Columns>
<asp:HyperLinkColumn Target="_parent" DataNavigateUrlField="url"
DataTextField="date"></asp:HyperLinkColumn>
<asp:HyperLinkColumn Target="_parent" DataNavigateUrlField="url"
DataTextField="headline"></asp:HyperLinkColumn>
</Columns>
</aspataGrid>
i have coded the following in the page load handler
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
DataSet ds=PressDBGateway.getNewsLinks();
dgNewsLinks.DataSource=ds;
dgNewsLinks.DataBind();
}
The problem is when i click on the hyperlink in the datagrid i go to a new
page but when i press back button of browser to come back to the datagrid
page,the datagrid gets loaded again and appends to the existing data.So
everytime i press the back button my datagrid keeps getting bigger and bigger
as the same set of records keep getting appended to it.
What am i doing wrong?
Thanks for your time.
I am a newbie and i need some help.I have datagrid on my asp.net page
which has hyperlink columns.
the datagrid configuration in the aspx page is as follows
<aspataGrid id="dgNewsLinks" DataKeyField="News_ID" runat="server"
Width="283px" AutoGenerateColumns="False" GridLines="None" ShowHeader="False">
<Columns>
<asp:HyperLinkColumn Target="_parent" DataNavigateUrlField="url"
DataTextField="date"></asp:HyperLinkColumn>
<asp:HyperLinkColumn Target="_parent" DataNavigateUrlField="url"
DataTextField="headline"></asp:HyperLinkColumn>
</Columns>
</aspataGrid>
i have coded the following in the page load handler
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
DataSet ds=PressDBGateway.getNewsLinks();
dgNewsLinks.DataSource=ds;
dgNewsLinks.DataBind();
}
The problem is when i click on the hyperlink in the datagrid i go to a new
page but when i press back button of browser to come back to the datagrid
page,the datagrid gets loaded again and appends to the existing data.So
everytime i press the back button my datagrid keeps getting bigger and bigger
as the same set of records keep getting appended to it.
What am i doing wrong?
Thanks for your time.