名站网址导航名站网址导航小编为爱好网页hTML5的朋友提供关于网页hTML5的相关知识。
- 本篇文章的具体介绍如下
--------Web.config----------------
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httphandlers>
<add verb="*" path="images/*.jpg" type="模块与处理程序.ImageDeal"/>
</httphandlers>
</system.web>
</configuration>
-------------ImageDeal.cs类-------------------------
namespace 模块与处理程序
{
public class ImageDeal:Ihttphandler
{
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(httpContext context)
{
Image img = Image.FromFile(context.Request.PhysicalPath);
Graphics g = Graphics.FromImage(img);
g.DrawString("QQ", new Font("宋体", 20, FontStyle.Bold), Brushes.Red, 10, 10);
img.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
context.Response.Flush();
context.Response.End();
}
}
}
----------default2.aspx前台------------------------
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="sid" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="sid" headerText="sid" InsertVisible="False"
ReadOnly="True" SortExpression="sid" />
<asp:BoundField DataField="sname" headerText="sname" SortExpression="sname" />
<asp:BoundField DataField="sex" headerText="sex" SortExpression="sex" />
<asp:BoundField DataField="age" headerText="age" SortExpression="age" />
<asp:ImageField DataImageUrlField="photo"
DataImageUrlFormatString="~/images/{0}" headerText="照片">
</asp:ImageField>
<asp:hyperLinkField DataNavigateUrlFields="sid,sname"
DataNavigateUrlFormatString="{0}/{1}/viewDetail.html" headerText="操作"
Text="查看详情" />
</Columns>
</asp:GridView>
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:studentConnectionString %>"
SelectCommand="SELECT [sid], [sname], [sex], [age], [photo] FROM [student]">
</asp:SqlDataSource>
</div>
</form>
</body>
-------------default3前台-----------------------
<body>
<form id="form1" runat="server">
<div>
<asp:Image ID="Image1" ImageUrl="http://localhost:1695/images/liubei.jpg" runat="server" />
</div>
</form>
</body>
关于网页hTML5的相关知识就说到这里希望可以帮助朋友们。,html5 input属性使用示例
placeholder 默认提示字符 autofocus 当页面加载时,会获得焦点的一个按钮 x-webkit-speech 语音搜索,webkit内核才支持 accept 规定可上传的相关站点文件类型(仅适用type=file) alt 规定图片输入控件代替文本 autocomplete 规定是否使用输入字段的自动完成功能 required 输入字段是必须的 step 输入数字的间隔 pattrn 对输入内容进行正则匹配