Click here to Skip to main content
15,889,909 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Question[Message Deleted] Pin
Linda1st14-Aug-08 9:59
Linda1st14-Aug-08 9:59 
AnswerRe: ASP.NET ups RateWS.dll test URL error message Pin
Manas Bhardwaj14-Aug-08 10:09
professionalManas Bhardwaj14-Aug-08 10:09 
AnswerIGNORE Pin
leckey14-Aug-08 14:32
leckey14-Aug-08 14:32 
GeneralRe: IGNORE Pin
Paul Conrad14-Aug-08 19:13
professionalPaul Conrad14-Aug-08 19:13 
QuestionHow to set up TypeName for objectDataSource in single-file model? Pin
JimFeng14-Aug-08 9:33
JimFeng14-Aug-08 9:33 
AnswerRe: How to set up TypeName for objectDataSource in single-file model? Pin
Manas Bhardwaj14-Aug-08 10:51
professionalManas Bhardwaj14-Aug-08 10:51 
GeneralRe: How to set up TypeName for objectDataSource in single-file model? Pin
JimFeng14-Aug-08 12:11
JimFeng14-Aug-08 12:11 
QuestionFile Upload Pin
student_rhr14-Aug-08 7:40
student_rhr14-Aug-08 7:40 
I have a gridview with a file upload:
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource2" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" GridLines="Vertical" DataKeyNames="Program_ID" Width="387px">
    <Columns>
        <asp:BoundField DataField="Program_ID" HeaderText="Program ID" SortExpression="Program_ID" />
        <asp:TemplateField HeaderText="Image Files for Program">
            <ItemTemplate>
                <asp:FileUpload ID="fileUpload" runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <FooterStyle BackColor="#CCCCCC" />
    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
    <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
    <AlternatingRowStyle BackColor="#CCCCCC" />
</asp:GridView>

For some reason, on postback, I am not getting any value from the file upload control:
//Button Click
foreach (GridViewRow row in GridView2.Rows)
        {
            FileUpload fileUpload = (FileUpload)row.FindControl("fileUpload");
            //Response.Write(fileUpload.FileName);
            if (!String.IsNullOrEmpty(fileUpload.FileName.Trim()))
            {
                // use the first file name for all if checkbox is checked.
                if (chkImageFile.Checked)
                {
                    if (String.IsNullOrEmpty(tempFileName))
                    {
                        tempFileName = fileUpload.FileName;
                        fileUpload.SaveAs(Server.MapPath("~/"));
                    }
                }
                else
                    tempFileName = fileUpload.FileName;              
            }
        }

Any idea whats going on?

P.S. I am using ajax but for this task a i am doing a complete postback. None of the controls listed here are inside an update panel.
AnswerRe: File Upload Pin
ToddHileHoffer14-Aug-08 9:36
ToddHileHoffer14-Aug-08 9:36 
Questionsmooth menus Pin
Subin Alex14-Aug-08 7:23
Subin Alex14-Aug-08 7:23 
AnswerRe: smooth menus Pin
Christian Graus14-Aug-08 11:45
protectorChristian Graus14-Aug-08 11:45 
AnswerI wud like... Pin
leckey14-Aug-08 14:33
leckey14-Aug-08 14:33 
Questionif employee present or absence [modified] Pin
sathyan_829414-Aug-08 7:03
sathyan_829414-Aug-08 7:03 
AnswerRe: if employee present or absence Pin
Christian Graus14-Aug-08 11:46
protectorChristian Graus14-Aug-08 11:46 
QuestionHow to save and display a sorted ListBox Control?? Pin
Imran Adam14-Aug-08 5:33
Imran Adam14-Aug-08 5:33 
GeneralRe: How to save and display a sorted ListBox Control??[Ignore - RePost] Pin
Manas Bhardwaj14-Aug-08 6:49
professionalManas Bhardwaj14-Aug-08 6:49 
AnswerIGNORE Pin
leckey14-Aug-08 14:34
leckey14-Aug-08 14:34 
AnswerRe: How to save and display a sorted ListBox Control?? Pin
Imran Adam14-Aug-08 22:56
Imran Adam14-Aug-08 22:56 
QuestionSpecial Row in Grid Pin
Nimua14-Aug-08 4:42
Nimua14-Aug-08 4:42 
AnswerRe: Special Row in Grid Pin
ToddHileHoffer14-Aug-08 9:41
ToddHileHoffer14-Aug-08 9:41 
QuestionLicense Cost for Visual Studio .NET ? Pin
Nizam Quadri14-Aug-08 2:57
Nizam Quadri14-Aug-08 2:57 
AnswerRe: License Cost for Visual Studio .NET ? Pin
Manas Bhardwaj14-Aug-08 3:26
professionalManas Bhardwaj14-Aug-08 3:26 
AnswerWTF? Pin
leckey14-Aug-08 5:28
leckey14-Aug-08 5:28 
GeneralRe: WTF? Pin
Paul Conrad14-Aug-08 6:44
professionalPaul Conrad14-Aug-08 6:44 
QuestionWhich is Better PHP or ASP.NET ? Pin
Nizam Quadri14-Aug-08 2:51
Nizam Quadri14-Aug-08 2:51 

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.