如何使用(imagefetch.aspx)页面上的文件上传控件从Web用户控制页面(top.ascx)中的数据库中加载图像? [英] how to load image from database in web user control page ( top.ascx) with fileupload controls on (imagefetch.aspx) page ?

查看:88
本文介绍了如何使用(imagefetch.aspx)页面上的文件上传控件从Web用户控制页面(top.ascx)中的数据库中加载图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,
我有一个top.ascx文件,用作所有aspx页面的admin:top我要做的是我必须从数据库中的top.ascx文件中加载三个公司徽标图像.所以我用fileupload控件创建了imagefetch.aspx页面,以将图像加载到top.ascx中.但是我不知道如何使用imagefetch.aspx文件中的fileupload控件从top.ascx文件中的databse加载图像.请帮助我













Top.ascx





< img src ="images/header_strip.jpg" alt =" style ="height:0px; width:100%"/>

Dear friends ,
I am having a top.ascx file which i am using as the admin:top for all the aspx pages what i have to do is i have to load three company logo images in top.ascx file from the database . so i have created imagefetch.aspx page with fileupload control to load the images in top.ascx . but i don''t have idea how to load image from databse in top.ascx file with fileupload controls in imagefetch.aspx file . so kindly help me













Top.ascx





<img src="images/header_strip.jpg" alt="" style="height: 0px; width: 100%" />


<%-< asp:Image ID ="Image1" runat ="server" ImageUrl =〜/images/c1.gif"/>-%> ;
< img id ="topcenterimg" runat =服务器" alt =" width ="251" height ="68"/>


<%--<asp:Image ID="Image1" runat="server" ImageUrl="~/images/c1.gif" />--%>
<img id="topcenterimg" runat="server" alt="" width="251" height="68" />


<%-< asp:HiddenField ID ="hdn" runat ="server" Value ="ShowImage.ashx?imageID"/>- -%>
<%-< asp:HiddenField ID ="HiddenField1" runat ="server" Value ="ImageID"/>-%>
< asp:Label ID ="Label12" runat ="server" Visible ="False">
<%-


<%--<asp:HiddenField ID="hdn" runat="server" Value="ShowImage.ashx?imageID" />--%>
<%--<asp:HiddenField ID="HiddenField1" runat="server" Value="ImageID" />--%>
<asp:Label ID="Label12" runat="server" Visible="False">
<%--


< img src ="images/nav/topnav_div.jpg" alt =" width ="3" height ="37"/>


<img src="images/nav/topnav_div.jpg" alt="" width="3" height="37" />


< img src ="images/nav/topnav_div.jpg" alt =" width ="3" height ="37"/>


<img src="images/nav/topnav_div.jpg" alt="" width="3" height="37" />


 
-%>

<%----%>
< asp:标签ID ="Label1" runat =服务器" BorderColor =#003399" Font-Bold ="True" Font-Italic ="False"
Font-Names ="Times New Roman" Font-Size ="Larger" ForeColor =#003399" Width ="179px"
Style ="margin-left:0px">欢迎使用CMS:<%=会话[用户名"]%>
< asp:LinkBut​​ton ID ="LinkBut​​ton1" runat ="server" Font-Bold ="True" OnClick ="LinkBut​​ton1_Click">退出


 








----------------------------

图片fetch.aspx文件:



<%@页面语言="C#" AutoEventWireup ="true" CodeFile ="ImageFetch.aspx.cs" Inherits ="ImageFetch"%>

<%@注册TagName ="top" TagPrefix ="Admin" Src =〜/Top.ascx"%>
<%@注册TagName ="side" TagPrefix ="Admin" Src =〜/JMenu.ascx"%>
<%@注册TagName ="bottom" TagPrefix ="Admin" Src =〜/Bottom.ascx"%>
<!DOCTYPE html PUBLIC-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns ="http://www.w3.org/1999/xhtml">
< head>
< title>集合管理系统</title>
< link rel =快捷方式图标" href ="favicon.ico"/>
< link rel ="icon" type ="image/gif" href ="animated_favicon1.gif"/>
< link href ="gridview.css" rel ="stylesheet" type ="text/css"/>
< link href ="style.css" rel ="stylesheet" type ="text/css"/>
</head>
< bodyönload="MM_preloadImages(''images/nav/home1.jpg'',''images/nav/contactus1.jpg'',''images/nav/sitemap1.jpg'',''images/nav/aboutus1.jpg'',''images/nav/services1.jpg'',''images/nav/feedback1.jpg'')>

< script language ="javascript" type ="text/javascript" src ="scripts/Validation.js"></script>

< form id ="form1" runat ="server">


 
--%>

<%----%>
<asp:Label ID="Label1" runat="server" BorderColor="#003399" Font-Bold="True" Font-Italic="False"
Font-Names="Times New Roman" Font-Size="Larger" ForeColor="#003399" Width="179px"
Style="margin-left: 0px"> Welcome To CMS :<%= Session["username"]%>
<asp:LinkButton ID="LinkButton1" runat="server" Font-Bold="True" OnClick="LinkButton1_Click">SignOut


 







----------------------------

Image fetch.aspx file :



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ImageFetch.aspx.cs" Inherits="ImageFetch" %>

<%@ Register TagName="top" TagPrefix="Admin" Src="~/Top.ascx" %>
<%@ Register TagName="side" TagPrefix="Admin" Src="~/JMenu.ascx" %>
<%@ Register TagName="bottom" TagPrefix="Admin" Src="~/Bottom.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>COLLEGE MANAGEMENT SYSTEM</title>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" type="image/gif" href="animated_favicon1.gif" />
<link href="gridview.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body önload="MM_preloadImages(''images/nav/home1.jpg'',''images/nav/contactus1.jpg'',''images/nav/sitemap1.jpg'',''images/nav/aboutus1.jpg'',''images/nav/services1.jpg'',''images/nav/feedback1.jpg'')">

<script language="javascript" type="text/javascript" src="scripts/Validation.js"></script>

<form id="form1" runat="server">




<%----%>
< Admin:顶部ID = "AT" runat ="server"/>

< Admin:侧面ID ="BB" runat ="server"/>


< img src ="images /Head/blkmas.PNG"/>

选择左上图像:
< asp:FileUpload runat =服务器" ID ="FileUpload1"/>
< asp:Label ID ="Label12" runat ="server" Visible ="False">
选择顶部中心图片:
< asp:FileUpload runat =服务器" ID ="FileUpload2"/>
选择右上图像:
< asp:FileUpload runat =服务器" ID ="FileUpload3"/>
选择左下角文本:
<%-< asp:FileUpload runat ="server" ID ="FileUpload4"/>-%>
< asp:TextBox ID ="txtBlt" runat ="server" Width ="210px">
选择右下角文本:
< asp:TextBox ID ="txtBrt" runat ="server" Width ="210px">
<%-< asp:FileUpload runat =服务器" ID ="FileUpload5"/>-%>
< asp:按钮ID ="Button2" runat =服务器" CssClass ="Sub" OnClick ="Button2_Click" />
< asp:Button ID ="Button3" runat ="server" CssClass ="Reset"/>
< asp:标签ID ="lblMessage" runat ="server" Font-Size ="Large" Font-Bold ="true">


< Admin:底部ID ="AB" runat ="server"/>
< asp:Button ID ="Button1" runat ="server" Style ="display:none;" OnClick ="Button1_Click"/>
< asp:Button ID ="Button4" runat ="server" Style ="display:none;" OnClick ="Button4_Click"/>





<%----%>
<Admin:top ID="AT" runat="server" />

<Admin:side ID="BB" runat="server" />


<img src="images/Head/blkmas.PNG" />

Select Top Left Image:
<asp:FileUpload runat="server" ID="FileUpload1" />
<asp:Label ID="Label12" runat="server" Visible="False">
Select Top Center Image:
<asp:FileUpload runat="server" ID="FileUpload2" />
Select Top Right Image:
<asp:FileUpload runat="server" ID="FileUpload3" />
Select Bottom Left Text:
<%--<asp:FileUpload runat="server" ID="FileUpload4" />--%>
<asp:TextBox ID="txtBlt" runat="server" Width="210px">
Select Bottom Right Text:
<asp:TextBox ID="txtBrt" runat="server" Width="210px">
<%-- <asp:FileUpload runat="server" ID="FileUpload5" />--%>
<asp:Button ID="Button2" runat="server" CssClass="Sub" OnClick="Button2_Click" />
<asp:Button ID="Button3" runat="server" CssClass="Reset" />
<asp:Label ID="lblMessage" runat="server" Font-Size="Large" Font-Bold="true">


<Admin:bottom ID="AB" runat="server" />
<asp:Button ID="Button1" runat="server" Style="display: none;" OnClick="Button1_Click" />
<asp:Button ID="Button4" runat="server" Style="display: none;" OnClick="Button4_Click" />



</form>
<%-<地图名称=地图" id =地图"><区域形状="rect" coords ="373,3,393,20" href =#"önclick="close_welcome_screen()"/></map>-%></body>
 </html>


</form>
<%--<map name="Map" id="Map"><area shape="rect" coords="373,3,393,20" href="#" önclick="close_welcome_screen()" /></map>--%></body>
 </html>

推荐答案

http://dotnetguts.blogspot.in/2007/09/web-user- control-in-aspnet.html [ ^ ]

http://www.c-sharpcorner.com/UploadFile/desaijm/ImageCanvasWebUserControl11162005045045AM/ImageCanvasWebUserControl.aspx [^ ]
How to display images in web user control in asp.net[^]

http://dotnetguts.blogspot.in/2007/09/web-user-control-in-aspnet.html[^]

http://www.c-sharpcorner.com/UploadFile/desaijm/ImageCanvasWebUserControl11162005045718AM/ImageCanvasWebUserControl.aspx[^]


这篇关于如何使用(imagefetch.aspx)页面上的文件上传控件从Web用户控制页面(top.ascx)中的数据库中加载图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆