--1.服务器端的下拉框

<asp:DropDownList ID="ddlSelectLineType" runat="server" Width="50" ></asp:DropDownList>

 

在脚本中得到服务器端的下拉框的脚本代码:

var first = $("ddlSelectLineType").value;

 

--2.服务器端的RadioButtonList

<asp:RadioButtonList ID="rblLineType" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal" onclick="changeType();">
                        <asp:ListItem Text="组1" Value="0" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="散2" Value="1"></asp:ListItem>
                        </asp:RadioButtonList>

 

脚本代码:

function changeType()
    {
         var test=document.getElementsByName("rblLineType");
         for(var i=0;i<test.length;i++){
            if(test[i].checked){
                if(test[i].value == "1"){
                    alert('散2!');

                   }

            }

    }

 

只是用于纪录备忘.

posted @ 2008-09-24 15:55 liyundong 阅读(109) 评论(0) 编辑

--编码
System.Convert.ToBase64String(System.Text.Encoding.Default.GetBytes(变量1)).Replace("+", "%2B")

--解码
System.Text.Encoding.Default.GetString(System.Convert.FromBase64String(Request["变量2"].Trim().Replace("%2B", "+")));

原因:这样可以有效的把"'",";","''"等的特殊符号彻底的进行编码,避免出现脚本错误等的信息。

js中的escape(变量)进行加密;
解密时用:using Microsoft.JScript;空间下的GlobalObject.unescape(变量)解密。这个对"'",";","''"等的特殊符号
不进行编译。

posted @ 2008-08-06 14:16 liyundong 阅读(29) 评论(1) 编辑

脚本代码如下:
function big(o)
{
 var zoom=parseInt(o.style.zoom, 10)||100;
 zoom+=window.event.wheelDelta/12;
 if (zoom>0) o.style.zoom=zoom+'%';
 return false;
}


例子:

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

<!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 runat="server">
    <title>用鼠标滑轮控制图片大小的显示</title>
<script type="text/javascript" language="javascript">
    // <![CDATA[
function big(o)
    {
     var zoom=parseInt(o.style.zoom, 10)||100;
     zoom+=window.event.wheelDelta/12;

     if (zoom>0) o.style.zoom=zoom+'%';

     return false;
    }
    //]]>
    </script>
</head>

<body 
    <form id="form1" runat="server" style="background-color:Gray;">

<img onload="javascript:if(this.width>498)this.style.width=498;"
src="http://images.cnblogs.com/help/hj_arrow.gif"
onmousewheel = "javascript:return big(this)" height="219" alt=""/>

    </form>
</body>
</html>

 

posted @ 2008-07-15 18:30 liyundong 阅读(220) 评论(0) 编辑
两个DIV在一起,不想让换行;添加属性display:inline即可。
posted @ 2008-06-18 17:42 liyundong 阅读(39) 评论(1) 编辑