fileupload in rowdatabound in grid view

Posted by Bhuwan87rawat under ASP.NET on 10/21/2013 | Points: 10 | Views : 5745 | Status : [Member] | Replies : 1
hello sir
In my application i want to upload a image/file in rowdatabound in gridview event
this is possibe in asp.net
because i face some problem to asp.cs page not getting the file name
like as
protected void gvCarrierCorner_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
Button bts = e.CommandSource as Button;


if (e.CommandName == "UpdateLinks")
{
// string Carrierid = gvCarrierCorner.DataKeys.[e.c].Value.ToString();

int CarrierCategoryId = Convert.ToInt32(e.CommandArgument.ToString());
GridViewRow row = gvCarrierCorner.Rows[CarrierCategoryId];
try
{

TextBox txtLinkName = ((TextBox)row.FindControl("txtLinkName"));
string name = txtLinkName.Text.ToString().Replace(",", "");

FileUpload flpdfurl = (FileUpload)row.FindControl("flpdfUrl");
string file = flpdfurl.ToString();
TextBox txtexlink = (TextBox)row.FindControl("txtexlink");
TextBox txtMessage = (TextBox)row.FindControl("txtMessage");
DropDownList drplinktype = (DropDownList)row.FindControl("drpLinkType");
string value = drplinktype.SelectedValue.ToString();
if (name != string.Empty)
{


if (flpdfurl.HasFile)
{




Responses

Posted by: Bandi on: 10/21/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer
http://www.dotnetfactor.com/Forum/how-to-use-fileupload-control-inside-gridview-inside-updatepannel-use-linkbutton-or-imagebutton-339.aspx
http://p2p.wrox.com/asp-net-3-5-professionals/76035-gridview-inside-updatepanel-not-uploading-image.html

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Bhuwan87rawat, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response