Click here to Skip to main content
15,891,777 members

Comments by parisa heidari (Top 23 by date)

parisa heidari 4-Jun-12 2:49am View    
It was true, however thanks.
parisa heidari 4-Jun-12 2:46am View    
Thank you so much :)
parisa heidari 4-Jun-12 2:38am View    
Yes but it wasn't fired so i changed my code and gridHomework was loaded but the hyperlink column was not changed:

protected void dpdGroup_SelectedIndexChanged(object sender, EventArgs e)
{

int GroupId =Convert.ToInt32( dpdGroup.SelectedItem.Value);

CourseGroup group = DB.CourseGroups.Where(g => g.Id == GroupId).First();

IEnumerable<homework> lstHomework = group.GetHomework();

GridHomework.DataSource = lstHomework;
GridHomework.DataBind();

foreach (GridViewRow gvRow in GridHomework.Rows)
{

int HwId = (int)GridHomework.DataKeys[gvRow.RowIndex].Value;

Homework Hw = DB.Homeworks.Where(h => h.Id == HwId).First();

HyperLink link = new HyperLink();

link =(HyperLink)gvRow.FindControl("HyperLink1");

link.NavigateUrl = Hw.DscripPath;
}

GridHomework.DataBind();
}

and in html:

<asp:TemplateField HeaderText="شرح تکلیف">
<itemtemplate>
<asp:HyperLink ID="HyperLink1" runat="server">ِDownload

parisa heidari 3-Jun-12 7:55am View    
Thank you Mr. bahrami it was useful.But what was the broblem why event wasn't fired?

When i set a break point it was fired and i found my problems in code.
parisa heidari 3-Jun-12 4:13am View    
I'm solving this problem with changing relations and use sgldatasource.