易截截图软件、单文件、免安装、纯绿色、仅160KB

js/css在ajax UpdatePanel 中没有效果的解决方法

js没效果:如果在以UpdatePanel的方式的局部回传中,普通的Javascript代码在这种局部回传中就不会在触发了,就必须使用scriptmanager.RegisterClientScript方法(在<form>后面注册<script>)和scriptmanager.RegisterStartupScript方法(在</form之前注册<script>)
在你的用户控件的后端的某个合适位置,采用合适的注册方法,比如说load事件可以写以下代码:
//你的javascript代码
string script="var a='helloworld';alert(a);";
this.page.scriptmanager.RegisterStartupScript(this.page,typeof(string),"scriptforusercontrol",script,true);
css没效果:
string   s   =   @"<LINK   href="Css/Styles5.css"   type="text/css"   rel="stylesheet">";  
ClientScript.RegisterStartupScript(this.GetType(), "", s);
这样就可以了。


相关文档:

CSS的边界重叠规则

In this specification, the expression collapsing margins means that adjoining margins (no non-empty content, padding or border areas or clearance separate them) of two or more boxes (which may be next to one another or nested) combine to form a single margin.
In CSS 2.1, horizontal margins ne ......

CustomValidator控件+ajax 实现注册时的异步验证

在.net的验证控件中有一个CustomValidator验证控件,其属性ClientValidationFunction为客户端函数,在需要验证的控件失去焦点或者post数据时,调用该函数。
前台:
 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomValidatorTest.aspx.cs" Inherits="Web.CustomValidatorTest" %>
<!DO ......

css hacks (ie6,ie7,ie8,firefox,Chrome)

分类:Web前端
IE6能识别下划线"_"和星号" * ",IE7能识别星号" * ",但不能识别下划线"_", IE8能识别" \9",但不能识别下划线"_", 而firefox两个都不能认识,却可以识别‘!important’。等等
书写顺序,一般是将识别能力强的浏览器的CSS写在后面。下面列举常用的CSS hack方法
 
 
1:!importan ......

jQuery Ajax 实例演示

<
script language=
"javascript"
>
 
$(
document)
.ready
(
function
(
)
{
$(
'#send_ajax'
)
.click
(
function
(
)
{
var
params=
$(
'input'
)
.serialize
(
)
;
//序列化表单的值
$.ajax
(
{
url:
'ajax_json.php'
,
//后台处 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号