本帖最后由 zsllin 于 2014-09-26 19:36:56 编辑

解决方案 »

  1.   

    FORM的enctype改成multipart/form-data
      

  2.   

    后台获取显示前台上传的图片示例
    //前台上传内容
        昵称:</td>
                    <td style="width: 122px; height: 5px;">
                        <asp:TextBox ID="txtNickname" runat="server"></asp:TextBox></td>
      <asp:FileUpload ID="fupImg" runat="server" />//上传控件
     <asp:Button ID="btnUp" runat="server" Text="上 传" OnClick="btnUp_Click" />//上传按钮
     <asp:Image ID="ImageHead" runat="server" Height="100px" Width="100px" />//显示图像
     <asp:Button ID="btnAmend" runat="server" Text="修 改" OnClick="btnAmend_Click" />//修改图像信息
    //后台显示图像
     <asp:GridView ID="ClassList" runat="server" AutoGenerateColumns="False"
                            CellPadding="4" Font-Size="11pt" GridLines="None" Width="613px" 
                                                    OnRowCancelingEdit="ClassList_RowCancetingEdit" 
                                                    OnRowDeleting="ClassList_RowDeleting" OnRowEditing="ClassList_RowEditing" 
                                                    ForeColor="#333333" AllowPaging="True" AllowSorting="True" 
                                                    OnPageIndexChanging="ClassList_PageIndexChangging" PageSize="6" 
                                                    OnRowDataBound="ClassList_RowDataBound">
                            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                            <Columns>//CodeGo.net/
                                <asp:TemplateField HeaderText="选项">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="CheckBox1" runat="server" Font-Size="9pt" Height="1px" Width="1px" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="HenuID" HeaderText="地址ID" />
                                <asp:BoundField DataField="UserName" HeaderText="用户名称" />
                                 <asp:BoundField DataField="zcsj" HeaderText="注册时间" />
                                           <asp:TemplateField HeaderText="主题图片">
                                                    <ItemTemplate>
                                                    <asp:Image id="Image1" runat="server" imageurl='<%# "../"+Eval("Images") %>' />//这里是显示图像在上级目录的imageurl文件夹中
                                                    </ItemTemplate>
                                                   <HeaderStyle HorizontalAlign="Center" />
                                                    <FooterStyle HorizontalAlign="Center" height="20px" width="20px" />
                                                   </asp:TemplateField>
                                                     <asp:HyperLinkField DataNavigateUrlFields="HenuID" DataNavigateUrlFormatString="yhxiugai.aspx?ID={0}"
                                                            HeaderText="修改信息" Text="修改信息" />
                                <asp:CommandField HeaderText="删除图片" ShowDeleteButton="True" DeleteText="删除图片" />
                            </Columns>
                            <SelectedRowStyle BackColor="#C5BBAF" ForeColor="#333333" Font-Bold="True" />
                            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                            <RowStyle BackColor="#E3EAEB" />
                            <EditRowStyle BackColor="#7C6F57" />
                        </asp:GridView>
    //这个是后台的Admin文件夹中的Admin_xian.aspx文件中的代码,使用控件显示前台图片功能,处理功能(略);