Dear all,
am using two type of uploading one file uploadcontrol(linkbutton download for upload files) another one href link in post both are saved in database. but one time upload for any one file only. another file hide how..
am code:
if (fileVideofile.HasFile)
{
//Save File to the proper directory
string filename = Path.GetFileName(fileVideofile.FileName);
fileVideofile.SaveAs(Server.MapPath("UploadFiles/") + filename);
Videofile = "UploadFiles/" + fileVideofile.FileName;
es/") + fileVideofile.FileName);
}
else
{
Videofile = "empty.wav";
fileVideofile.SaveAs(Server.MapPath("UploadFiles/") + Videofile);
cmd.Parameters.AddWithValue("@Uploadimages",Videofile);
cmd.Parameters.AddWithValue("@Url", txtUrl.Text);
<asp:GridView ID="GridVideofile" runat="server" AutoGenerateColumns="false" Width="647px"
CssClass="GV" onrowdatabound="GridVideofile_RowDataBound"
ShowHeader="False">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<tr>
<td>
Download Video File :
<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click" Visible="True">Download File</asp:LinkButton>
</td>
</tr>
<tr>
<td>
Url Video File :
<a href='<%#Eval("Url")%>' target="_blank"><%#Eval("Url")%></a>
</td>
</tr>
</ItemTemplate>
</asp:TemplateField>
</Columns>
if (e.Row.RowType == DataControlRowType.DataRow)
{
{
LinkButton lnk = (LinkButton)e.Row.FindControl("LinkButton1");
if (!String.IsNullOrEmpty(lnk.Text))
{
lnk.Visible = true;
}
else
{
lnk.Visible = false;
}
}
}
Advance Thanks
chandru