日期:2014-05-17  浏览次数:20971 次

WdatePicker在用户控件里如何获取文本框值,请高手请教!!!
附上代码:
<asp:TextBox ID="txtDateFrom" runat="server" ReadOnly="True" onfocus="WdatePicker({})"
  CssClass="input1"></asp:TextBox> 

<img onclick="WdatePicker({el:$dp.$('txtDateFrom')})" src="../Images/main/cal.gif" 
  style="cursor: pointer" />

ps:点击img图标的时候无法弹出.在普通页面内可以正常显示...请高手指点。谢谢啦

------解决方案--------------------
HTML code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="flexbox.aspx.cs" Inherits="WebApplication3.flexbox"
    ValidateRequest="false" %>

<!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 src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="Scripts/My97DatePicker/WdatePicker.js"></script>
     <script type="text/javascript">
        $(function () {
            $('#btnShow').click(function () {
                var li = $('#txtStartCreateTime').val();
                alert(li);
            }
            )
        })
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:TextBox ID="txtStartCreateTime" runat="server" onFocus="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" />
    <input id="btnShow" type="button" value="显示" />
    </form>
</body>
</html>

------解决方案--------------------
onFocus="WdatePicker(skin;'whygreen',isshowclear:false,dateFmt:'yyyy-MM-dd HH:mm:ss'})" 
在用户控件里设置属性取值txt.Text