易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 :

ASP.NET

可以使用 Literal Web 服务器控件作为页面上其他内容的容器。
 
一、方案
Literal 最常用于向页面中动态添加内容。
 
二、背景
Literal 控件表示用于向页面添加内容的几个选项之一。对于静态内容,无需使用容器,可以将标记作为 HTML 直接添加到页面中。但是,如果要动态添加内容,则必须将内容添加到容器中。典型的容器有 Label 控件、Literal 控件、Panel 控件和 PlaceHolder 控件。
Literal 控件与 Label 控件的区别在于 Literal 控件不向文本中添加任何 HTML 元素。(Label 控件呈现一个 span 元素。)因此,Literal 控件不支持包括位置属性在内的任何样式属性。但是,Literal 控件允许指定是否对内容进行编码。
Panel 和 PlaceHolder 控件呈现为 div 元素,这将在页面中创建离散块,与 Label 和 Literal 控件进行内嵌呈现的方式不同。
通常情况下,当希望文本和控件直接呈现在页面中而不使用任何附加标记时,可使用 Literal 控件。
 
在 Literal 控件中编码内容
Literal 控件支持 Mode 属性,该属性用于指定控件对您所添加的标记的处理方式。可以将 Mode 属性设置为以下值:
·Transform. 将对添加到控件中的任何标记进行转换,以适 ......

ASP.NET

      Localize Web 服务器控件使您可以在页的特定区域中显示本地化后的文本。
 
一、背景
Localize 控件与 Literal Web 服务器控件完全相同,并与 Label Web 服务器控件相似。虽然 Label 控件可让您向显示的文本应用样式,但 Localize 控件不允许这样做。通过设置从 Literal 控件继承的 Text 属性,您可以以编程方式控制在 Localize 控件中显示的文本。
 
      1、编码内容
Localize 控件支持 Mode 属性,该属性用于指定控件对您所添加的标记的处理方式。可以将 Mode 属性设置为以下值:
·Transform 添加到控件中的任何标记都将进行转换,以适合发出请求的浏览器的协议。如果向使用 HTML 以外的其他协议的移动设备呈现内容,此设置非常有用。
·PassThrough 添加到控件中的任何标记都将按原样呈现在浏览器中。
·Encode 添加到控件中的任何标记都将使用 HtmlEncode 方法进行编码,该方法将把 HTML 编码转换为其文本表示形式。例如,<b> 标记将呈现为 &lt;b&gt;。当希望浏览器显示而不解释标记时,编码将很有用。编码对于安全也很有用,有助于防止在浏览器中执行恶 ......

ASP.NET技巧:使用Gridview绑定数据库中的图片

使用Gridview绑定数据库中的图片
注:此系列记录在我实际开发中遇到的问题和收藏一些技巧文章。
我们都知道,在Gridview中不能直接去绑定数据库中的图片,我们可以利用HttpHandler很容易的完成这个任务,在这里我记录一下这个过程。
1.上传图片存储到数据库中
在数据库中创建一个表,添加一下3个字段:
步骤一:在Web页面中拖一个FileUpload 控件,一个文本框用于输入名称和提交上传按钮
<asp:FileUpload ID="fuImage" runat="server" /><br />
<asp:TextBox ID="txtImageName" runat="server"/><br />
<asp:Button ID="btnUpload" runat="server" onClick="btnUpload_Click" Text="Upload" />
步骤二:在Web.Config文件内配置连接字符串。
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;
AttachDbFilename=|DataDirectory|\Image.mdf;Integrated Security=True;
User Instance=True" providerName="System.Data.SqlClient"/>
步骤三:把下面的代码复制到上传按钮事件中。
protected void btnUpload_Click(object sender, EventArgs e)
{
Stream imgStream = fuImage.PostedFile.Inpu ......

asp.net中实现简繁体转化

1.bin添加引用ChineseConverter.dll
2. 添加using Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter;
  
string strTest = "繁體字";
   
 Response.Write(string.Format("繁体输出:{0}<br/>", ChineseConverter.Convert(strTest, ChineseConversionDirection.SimplifiedToTraditional)));
Response.Write(string.Format("简体输出:{0}<br/>", ChineseConverter.Convert(strTest, ChineseConversionDirection.TraditionalToSimplified))); ......

解决ASP.NET下的MENU控件在IE8中不显示的问题

原地址:http://blogs.msdn.com/giorgio/archive/2009/02/01/asp-net-menu-and-ie8-rendering-white-issue.aspx
ASP.NET Menu and IE8 rendering white issue
If you are using the ASP.NET Menu control, you might encounter under certain circumstances an issue where the menu appears as a white box in IE8 Standards Mode.
What IE8 is doing IS correct (by design), in the sense that in Standards mode IE8 is following the standards. Specifically, (element).currentStyle.zIndex returns "auto" in Standards mode when zindex has not been set. The ASP.NET Menu control assumes a different value.
I’d like to suggest a few possible workarounds to solve quickly the issue (note, you can use either one of them, depending on your scenario):
Overriding the z-index property
Using CSS Friendly Control Adapters
Adding the IE7 META tag to the website
1 – Overriding the z-index property
You can manually set the z-index property of the Menu items using the DynamicMenuStyle property of the asp:Menu ......

ASP.NET动态加载用户控件的页面生成过程

 MainPage文件:WebForm1.aspx
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="TestMasterPage.WebForm1" enableViewState="False"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    <HEAD>
        <title>WebForm1</title>
    </HEAD>
    <body MS_POSITIONING="GridLayout">
        <form id="Form1" method="post" runat="server">
            <asp:PlaceHolder id="PlaceHolder1" runat="server"></asp:PlaceHolder></form>
    </body>
</HTML>
WebForm1.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System. ......
总记录数:40319; 总页数:6720; 每页6 条; 首页 上一页 [5128] [5129] [5130] [5131] 5132 [5133] [5134] [5135] [5136] [5137]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号