-
浅谈ASP.NET的Postback 实例代码第1/2页
所属栏目:[Asp教程] 日期:2021-07-24 热度:128
我们知道,无论是ASP.NET1.x,2.0,甚至是以后的版本,ASP.NET最终Render到Client端通过浏览器浏览的都是一样:一个单纯的HTML。Client通过Submit Form的方式将填入Form的数据提交给Server进行处理。我们现在来看看ASP.NET整个Postback程序处理的过程。 首先[详细]
-
asp.net js模拟Button点击事件
所属栏目:[Asp教程] 日期:2021-07-24 热度:103
script type="text/javascript" ///模拟按钮点击事件,插入数据 function addTmpDataApp() { document.%=formCC.ClientID %.%=btnjh.ClientID %.click(); } /script 这有时候是无法执行模拟点击的. 需要加上一句代码就可以了. 复制代码 代码如下: script t[详细]
-
asp.net datalist 用法
所属栏目:[Asp教程] 日期:2021-07-24 热度:199
设计模版: 页眉 HeaderTemplate /HeaderTemplate 页脚 FooterTemplate /FooterTemplate 数据记录 ItemTemplate /ItemTemplate AlternatingItemTemplate 交替显示项 /AlternatingItemTemplate SelectedItemTemplate选中时的显示方式 /SelectedItemTemplate[详细]
-
使用母版页时内容页如何使用css和javascript
所属栏目:[Asp教程] 日期:2021-07-24 热度:174
好处有了,问题也接着来了。原来在频道页和列表页中有其各自的css引入和一些javascript函数,当使用母版页时,放在内容页中这些css样式和javascript函数怎么处理呢?因为大家知道,使用母版页的内容页是不能包含head/head标记的,而css和javascript函数的声[详细]
-
ASP.NET 服务器路径和一般资源调用
所属栏目:[Asp教程] 日期:2021-07-24 热度:157
%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadioButtonListDemo.aspx.cs" Inherits="_Default" % !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" html xmlns=[详细]
-
常用JavaScript代码提示公共类封装
所属栏目:[Asp教程] 日期:2021-07-24 热度:132
using System; using System.Web; namespace Jake.PublicJS { /// summary /// Summary description for PublicJS /// /summary public class PublicJS { public PublicJS() { // // TODO: Add constructor logic here // } /// summary /// 1.静态方法,弹[详细]
-
C# 生转换网页为pdf
所属栏目:[Asp教程] 日期:2021-07-24 热度:80
从htm生成pdf大概可以分两步实现,第一步,解析htm,就是将htm源文件中那一对文本转换为浏览器最终呈现给我们那种图文并茂的结果。这是一个不可完成的任务,因为目前为止业界的软件巨头也没有谁把htm解析做得很好的。对比ie、firefox等浏览器的显示结果便可[详细]
-
一个简单的自定义程序日志小样例
所属栏目:[Asp教程] 日期:2021-07-24 热度:88
using System; using System.IO; using System.Text; public class LogInfo { private string ErrorInfo_User = ""; // 记录用户自定义错误信息 private string ErrorPosition = ""; // 记录错误的位置信息,可包括类、函数等 private string ErrorInfo_Sy[详细]
-
asp.net 多数据库支持的思考
所属栏目:[Asp教程] 日期:2021-07-24 热度:96
一般的多数据库支持在配置文件中如下: 复制代码 代码如下: connectionStrings add connectionString="server=(local);user id=sa;pwd=123456;database=mycms;"/ /connectionStrings 而数据库连接如下: 复制代码 代码如下: using System; using System.Col[详细]
-
asp.net BOF或EOF有一个是真,或者当前记录已被删除
所属栏目:[Asp教程] 日期:2021-07-24 热度:92
我们这时要做的就是在使用Recordset对象的moveNext 等方法之前先利用RecordsetCount属性判断一下数据库中的数据是否为空方法: 复制代码 代码如下: dim objRs as New Recordset dim objCn as New connection dim strSql as string objCn.ConnectionString="[详细]
-
c#中带头(声明)的xml(封装)生成
所属栏目:[Asp教程] 日期:2021-07-24 热度:148
XmlDocument downLoadFilexml = new XmlDocument(); XmlElement root = null; XmlElement kisokChild = null; //生成xml的头 XmlNode xmlnode= downLoadFilexml.CreateXmlDeclaration("1.0", "utf-8", null); downLoadFilexml.AppendChild(xmlnode); root[详细]
-
asp.net Repeater之非常好的数据分页
所属栏目:[Asp教程] 日期:2021-07-24 热度:54
副标题#e# 分页控件源代码如下: 复制代码 代码如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Collect[详细]
-
asp.net 过滤图片标签的正则
所属栏目:[Asp教程] 日期:2021-07-24 热度:175
public static string replaceImgUrl(string html) { if (html == null) return ""; System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@"img[^]+", System.Text.RegularExpressions.RegexOptions.IgnoreCase);[详细]
-
asp.net Linq To Xml上手Descendants、Elements遍历节点
所属栏目:[Asp教程] 日期:2021-07-24 热度:193
首先准备一个简单但是常见的XML 复制代码 代码如下: ?xml version="1.0" encoding="utf-8" ? userSet userInfo profile phoneNumber13818181818/phoneNumber countryChina/country /profile /userInfo userInfo profile phoneNumber13919191919/phoneNumber[详细]
-
asp.net 弹出警告窗口实现代码
所属栏目:[Asp教程] 日期:2021-07-23 热度:172
/// summary /// 提供一个可[详细]
-
asp.net 用户控件读取以及赋值
所属栏目:[Asp教程] 日期:2021-07-23 热度:158
?xml version="1.0" encoding="utf-8" ? SystemVersion Item Version_ID1/Version_ID Version_NameCN/Version_Name /Item Item Version_ID2/Version_ID Version_NameEN/Version_Name /Item /SystemVersion 用户控件的关键代码: SystemVersion.ascx 复制代[详细]
-
asp.net结合aspnetpager使用SQL2005的存储过程分页
所属栏目:[Asp教程] 日期:2021-07-23 热度:104
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go ALTER PROCEDURE [dbo].[P_GetPagedReCord] (@startIndex INT, -- 开始索引号 @endindex INT, -- 结束索引号 @tblName varchar(255), -- 表名 @fldName varchar(255), -- 显示字段名 @OrderfldName varchar[详细]
-
ASP.NET 页面中动态增加的控件、添加事件第1/2页
所属栏目:[Asp教程] 日期:2021-07-23 热度:105
要求:页面上有一个Add按钮,每点击一次该按钮,页面上动态创建一个WebPartZone! 提醒:WebPartZone只能在OnInit或之前才能创建,否则报异常! 大家都知道,按钮的点击事件是在RaisePostbackEvent时触发的,这意味着点击事件在OnLoad阶段之后才执行,远远[详细]
-
VB.net 查询获取数据库数据信息
所属栏目:[Asp教程] 日期:2021-07-23 热度:70
'数据操作执行 Public Sub getConn(ByVal SqlStr As String, ByVal TableName As String) Try objCommand.CommandText = SqlStr objDataSet.Clear() objDataAdapter.SelectCommand = objCommand objDataAdapter.Fill(objDataSet, TableName) Catch ex As E[详细]
-
asp.net连接数据库 增加,修改,删除,查询代码
所属栏目:[Asp教程] 日期:2021-07-23 热度:89
'数据库连接 Public Sub connectionDB() Try serverUrl = readFromIni(My.Application.Info.DirectoryPath "config.dll", "Service Information", "IPAddress") serverID = readFromIni(My.Application.Info.DirectoryPath "config.dll", "Service Infor[详细]
-
asp.net 操作XML 按指定格式写入XML数据 WriteXml
所属栏目:[Asp教程] 日期:2021-07-23 热度:150
Private Sub WriteXml() Try Create(strFName, "NewDataSet") SaveXMLFile("gg", "NewDataSet", True) Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Function Create(ByVal FileName As String, ByVal Root As String) As Boolean D[详细]
-
asp.net 存储过程调用
所属栏目:[Asp教程] 日期:2021-07-23 热度:72
1.调用存储过程,但无返回值 复制代码 代码如下: Private Function SqlProc1(ByVal ProcName As String) As Boolean '定义数据链接部分省略, myConn为链接对象 ProcName为存储过程名 Dim myCommand As New SqlClient.SqlCommand(ProcName, myConn) With my[详细]
-
php 三级联动菜单
所属栏目:[Asp教程] 日期:2021-07-23 热度:169
-- 表的结构 `bigclass` -- CREATE TABLE `bigclass` ( `bigclassid` int(11) NOT NULL auto_increment, `bigclassname` varchar(200) collate utf8_unicode_ci NOT NULL, `sort` int(11) NOT NULL, `suoshu` int(1) NOT NULL, PRIMARY KEY (`bigclassid`)[详细]
-
asp.net GridView导出到Excel代码
所属栏目:[Asp教程] 日期:2021-07-23 热度:64
StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); HtmlTextWriter htw = new HtmlTextWriter(sw); Page page = new Page(); HtmlForm form = new HtmlForm(); GVLinkman.EnableViewState = false; page.EnableEventValid[详细]
-
如何用Response.Redirect方法传递汉字
所属栏目:[Asp教程] 日期:2021-07-22 热度:127
使用Response.Redirect方法传递汉字,有时会发现所传递的值和接收到的内容不符,接受的值丢失了几个字或者变成了一堆乱码.那么如何才能保证所传递的汉字被正确接收呢? 页面A传递值的代码如下:stringMessage=Server.UrlEncode("欢迎学习ASP.NET!"); Response.[详细]