Click here to Skip to main content
15,907,149 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Accessing Menu Items (C#) Pin
totocaster17-Jul-07 20:43
totocaster17-Jul-07 20:43 
QuestionDescription field binding Pin
samerh16-Jul-07 20:23
samerh16-Jul-07 20:23 
QuestionError in invoking upload_serverclick method Pin
Hari_101016-Jul-07 19:55
Hari_101016-Jul-07 19:55 
AnswerRe: Error in invoking upload_serverclick method Pin
N a v a n e e t h16-Jul-07 20:12
N a v a n e e t h16-Jul-07 20:12 
QuestionRe: Error in invoking upload_serverclick method Pin
Hari_101016-Jul-07 20:21
Hari_101016-Jul-07 20:21 
AnswerRe: Error in invoking upload_serverclick method Pin
N a v a n e e t h16-Jul-07 20:42
N a v a n e e t h16-Jul-07 20:42 
GeneralRe: Error in invoking upload_serverclick method Pin
Hari_101016-Jul-07 20:45
Hari_101016-Jul-07 20:45 
GeneralRe: Error in invoking upload_serverclick method Pin
N a v a n e e t h16-Jul-07 20:59
N a v a n e e t h16-Jul-07 20:59 
First you need to place a gridview. Add a template column. In ItemTemplate add
<input type="file" id="MyFileUpload" runat="server">

Assume you need to upload 5 file. So you need 5 rows in grid view. For that create a dummy datatable with 5 records and bind to gridview. Now you will see gridview binding with 5 records and in each row you will get each file upload control.

Down to gridview place a button. Inside button click write

for ( int i=0;i<GridviewRows;i++)
{
    HtmlInputFile fileUpload = (HtmlInputFile)GridView.Rows[i].Cells[FileUploadCell].
FindControl("MyFileUpload");
    fileUpload.PostedFile.SaveAs("YourServerLocation");//Need to use server.mappath
}


FindControl method will find the control from gridview and give you the object. Using that object you can do upload. You need to handle exception efficiently. This will raise NullReferenceException if FindControl() is not getting the object. So make sure that you will specify the cell where FileUploadControl resides.




GeneralRe: Error in invoking upload_serverclick method Pin
Hari_101016-Jul-07 21:07
Hari_101016-Jul-07 21:07 
GeneralRe: Error in invoking upload_serverclick method Pin
N a v a n e e t h16-Jul-07 21:32
N a v a n e e t h16-Jul-07 21:32 
GeneralRe: Error in invoking upload_serverclick method Pin
Hari_101016-Jul-07 20:58
Hari_101016-Jul-07 20:58 
GeneralRe: Error in invoking upload_serverclick method Pin
N a v a n e e t h16-Jul-07 21:02
N a v a n e e t h16-Jul-07 21:02 
Questionhttp error 500(argent) Pin
Piyush Vardhan Singh16-Jul-07 19:46
Piyush Vardhan Singh16-Jul-07 19:46 
AnswerRe: http error 500(argent) Pin
Piyush Vardhan Singh16-Jul-07 19:48
Piyush Vardhan Singh16-Jul-07 19:48 
Questionhow to interact an image to a database value Pin
duo!@#16-Jul-07 19:45
duo!@#16-Jul-07 19:45 
AnswerRe: how to interact an image to a database value Pin
Mubashir Javaid16-Jul-07 20:15
Mubashir Javaid16-Jul-07 20:15 
GeneralRe: how to interact an image to a database value Pin
duo!@#16-Jul-07 21:53
duo!@#16-Jul-07 21:53 
GeneralRe: how to interact an image to a database value Pin
duo!@#16-Jul-07 22:00
duo!@#16-Jul-07 22:00 
GeneralRe: how to interact an image to a database value Pin
Mubashir Javaid16-Jul-07 22:31
Mubashir Javaid16-Jul-07 22:31 
GeneralRe: how to interact an image to a database value Pin
duo!@#16-Jul-07 22:02
duo!@#16-Jul-07 22:02 
GeneralRe: how to interact an image to a database value Pin
Mubashir Javaid16-Jul-07 22:08
Mubashir Javaid16-Jul-07 22:08 
AnswerRe: how to interact an image to a database value Pin
_AK_16-Jul-07 20:18
_AK_16-Jul-07 20:18 
Questiontable in classic asp Pin
Sebastian T Xavier16-Jul-07 19:43
Sebastian T Xavier16-Jul-07 19:43 
AnswerRe: table in classic asp Pin
N a v a n e e t h16-Jul-07 20:13
N a v a n e e t h16-Jul-07 20:13 
GeneralRe: table in classic asp Pin
Sebastian T Xavier16-Jul-07 22:44
Sebastian T Xavier16-Jul-07 22:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.