posts - 10,  comments - 19,  trackbacks - 4
  2005年5月15日
在提交 数据时候提示如下:
  出现了运行时间错误,是否要进行调试?
  行79,错误类型:无效指针。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    
<HEAD>
        
<title>myorder</title>
        
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
        
<meta content="C#" name="CODE_LANGUAGE">
        
<meta content="JavaScript" name="vs_defaultClientScript">
        
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
        
<style type="text/css">BODY {}{ }
    A A:link A:visited 
{}{ TEXT-DECORATION: none }
    A:hover 
{}{ COLOR: navy; TEXT-DECORATION: underline }
        
</style>
    
</HEAD>
    
<body topMargin="0" MS_POSITIONING="GridLayout">
        
<IFRAME ID=__hifSmartNav NAME=__hifSmartNav STYLE=display:none src="/aspnet_client/system_web/1_1_4322/SmartNav.htm"></IFRAME>
<form name="Form1" method="post" action="myinfo.aspx" id="Form1" __smartNavEnabled="true">
<input type="hidden" name="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" value="+O2w8aTwxPjtpPDI1PjtpPDI1PjtsPD47Pj47Pjs7Ozs7Ozs7Ozs++Pjs+Ozs+Oz4+O3Q8O2w8aTwwPjtpPDE+Oz47bDx0PDtsPGk8MT47PjtsPHQ8cDxwPGw8TmF2aWdhdGVVcmw7PjtsPFByb2R1Y3REZXRhaWxzLmFzcHg/=" />

<script language="javascript">
<!--
    
function __doPostBack(eventTarget, eventArgument) {
        
var theform;
        
if (window.navigator.appName.toLowerCase().indexOf("netscape"> -1{
            theform 
= document.forms["Form1"];
        }

        
else {
            theform 
= document.Form1;
        }

        theform.__EVENTTARGET.value 
= eventTarget.split("$").join(":");
        theform.__EVENTARGUMENT.value 
= eventArgument;
        theform.submit();
    }

// -->
</script>

<script language="JScript" src="/aspnet_client/system_web/1_1_4322/SmartNav.js"></script>


<input type="hidden" name="_VIEWSTATE" value="……"
就是出现这行错误,不晓得是什么原因。据说是framework产生的两个asp.net的 js文件有问题。

但是如果点击否不调试的话,所有的提交功能还是会去实现的。也就是说,本来要弹出个提示提交成功窗口或跳转到其他页面,但是它现在弹出个错误消息框。
 
posted @ 2005-05-15 21:04 zfphere 阅读(698) 评论(0) 编辑
  2005年3月12日

        前几天为客户做WEB系统的时候,需要在每个页面的header 上面加个“退出系统”的连接;而且要有确认对话框。一般就是通过添加“ this.LinkButton.Attributes.Add("OnClick","javascript:return confirm('您确定要退出系统吗?')") ”脚本。然而由于在主页面也有相类似的提示框,所以在Framwork1.1下可能会出现“htmlfile:指针无效”,然后整个页面无法加载CSS样式。
        这里给出了个解决的办法,具体的看下面:

1--可以将自定义控件的子控件(与javascript相关连,如 LinkButton LbnQuit)定义成 public属性
2--在引用该控件的页面添加 对该自定义空间的引用,如:
   public bankofchina.userContorl.header Header1;
   该自定义在html文件中的定义为:
   <uc1:header id="Header1" runat="server"></uc1:header>
   这样我们就像定义了一个类似WebControl的控件。
  
3--在引用该控件的页面里面添加这么一条语句:
   Header1.LbnQuit.Attributes.Add("OnClick","javascript:return confirm('您确信要退出系统?');");
4--由于上面的事件给LbnQuit定义了个点击该控件便弹出对话框的功能,这时候如果用户“确认提示”,应该能继续
   做下面的事情,例如:
   Session.Clear();//window.opener=null;
   Session["class"]="-1";  
   //Response.Write("<script language=javascript>self.close();</script>");//这个不能添加的
   为了让上面的能够执行下去,我们可以定义一个单击事件
   private void LbnQuit_Click(object sender, System.EventArgs e)

小结:
    经过上面的几个步骤,我们就可以实现如下流程的功能:
    页面显示该控件-->单击该控件-->弹出确认对话框-->确认提示--->执行定义的事件处理函数-->结束
                                                    │                                                                               ↑
                                                     ---------------取消确认-----------------------------------

   
    本来想设置它为 public static,然后在Application_Start()里 初始话这个LinkButton.但是编译通不过,想知道怎么解决.
posted @ 2005-03-12 13:22 zfphere 阅读(3449) 评论(0) 编辑
  2005年1月31日

再谈SQL Server表与Excel、Access数据互导

posted @ 2005-01-31 09:40 zfphere 阅读(496) 评论(0) 编辑
  2004年12月29日
井字棋

<html>
<head>
</head>
<script language="javascript">
var index=-1;
////////////
function play(buttons)
{
    index
=-1*index;
    
if(index==1)
    {
        buttons.value
="#";
        getWiner();
        
return false;
    }
    buttons.value
="&";
}
/////////////
function getWiner()
{
    
if(form1.B1.value!=""&&form1.B1.value==form1.B2.value&&form1.B1.value==form1.B3.value)//1
    {
        alert(form1.B1.value
+" is the winer!");
    }
    
if(form1.B1.value!=""&&form1.B1.value==form1.B4.value&&form1.B1.value==form1.B7.value)//2
    {
        alert(form1.B1.value
+" is the winer!");
    }
    
if(form1.B1.value!=""&&form1.B1.value==form1.B5.value&&form1.B1.value==form1.B9.value)//3
    {
        alert(form1.B1.value
+" is the winer!");
    }
    
if(form1.B2.value!=""&&form1.B2.value==form1.B5.value&&form1.B2.value==form1.B8.value)//4
    {
        alert(form1.B2.value
+" is the winer!");
    }
    
if(form1.B3.value!=""&&form1.B3.value==form1.B6.value&&form1.B3.value==form1.B9.value)//5
    {
        alert(form1.B3.value
+" is the winer!");
    }
    
if(form1.B3.value!=""&&form1.B3.value==form1.B5.value&&form1.B3.value==form1.B7.value)//6
    {
        alert(form1.B3.value
+" is the winer!");
    }
    
if(form1.B4.value!=""&&form1.B4.value==form1.B5.value&&form1.B4.value==form1.B6.value)//7
    {
        alert(form1.B4.value
+" is the winer!");
    }
    
if(form1.B7.value!=""&&form1.B7.value==form1.B8.value&&form1.B7.value==form1.B9.value)//8        
    {
        alert(form1.B7.value
+" is the winer!");
    }
    
return false;
}
</script>
 
<body>
   
<form method="POST" name="form1" >

         
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="20%" height="89">
       
<tr>
         
<td width="33%" height="31" align="center">
         
<p align="center"><input type="button" name="B1" onClick="play(this)"></td>
         
<td width="33%" height="31" align="center">
         
<p align="center"><input type="button" name="B2" onClick="play(this)"></td>
         
<td width="34%" height="31" align="center">
         
<input type="button" name="B3" onClick="play(this)"></td>
       
</tr>
       
<tr>
         
<td width="33%" height="29" align="center">
         
<input type="button" name="B4" onClick="play(this)"></td>
         
<td width="33%" height="29" align="center">
         
<input type="button" name="B5" onClick="play(this)"></td>
         
<td width="34%" height="29" align="center">
         
<input type="button" name="B6" onClick="play(this)"></td>
       
</tr>
       
<tr>
         
<td width="33%" height="29" align="center">
         
<input type="button" name="B7" onClick="play(this)"></td>
         
<td width="33%" height="29" align="center">
         
<input type="button" name="B8" onClick="play(this)"></td>
         
<td width="34%" height="29" align="center">
         
<input type="button" name="B9" onClick="play(this)"></td>
       
</tr>
     
</table>
   
</form>
 
</body>
</html>
posted @ 2004-12-29 21:11 zfphere 阅读(595) 评论(0) 编辑
正如 灵感之源所说,语言是相通的!
不过到现在,好象还没专门的Javascript调试环境
还好Mozilla里面带了个,昨天刚下载的,感觉还不错
<html>
<head>
</head>
<script language="javascript">
function Check()
{
  
if(form1.tbx1.value.length<1)
     {
         alert(
"姓名不能为空!","警告");
         
return false;
     }     
  
if(form1.tbx2.value.length<1)
     {
         alert(
"密码不能为空!","警告");
         
return false;
     }
  
var sum=eval(form1.tbx1.value+form1.tbx2.value);
  alert(sum,
"警告");
}
function input(select)
{
 
if(select==1)
   {
       form1.tbx1.value
=prompt("input first one number:","");
       
return false;
   }
 form1.tbx2.value
=prompt("input second one number:","");
 
return false;
}
</script>
 
<body>
   
<form method="POST" name="form1" >
     
<p>
     姓名:
<input type="text" name="tbx1" size="20" onFocus="input(1)" > 
     密码:
<input type="text" name="tbx2" size="20" onFocus="input(2)" ></p>
     
<p><input type="button" value="提交" name="btn1" onClick="Check()">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     
<input type="button" value="重置" name="Btn2"></p>
   
</form>
   
<br>
   
<script language="javascript">
     
//alert("这是我的第一个测试!","呵呵");
       document.writeln("it works <br>"+" and I love it");  
  
//     var colors = prompt("输入您需要的颜色:","#ff00ff");
  //     document.write("您选择的颜色是:<font color=#ff00ff>"+colors+"</font>");
    </script>
 
</body>
</html>
posted @ 2004-12-29 18:10 zfphere 阅读(1373) 评论(2) 编辑
  2004年12月22日
如图
posted @ 2004-12-22 17:22 zfphere 阅读(755) 评论(1) 编辑
  2004年12月19日
posted @ 2004-12-19 13:15 zfphere 阅读(2219) 评论(0) 编辑
  2004年12月5日
posted @ 2004-12-05 17:54 zfphere 阅读(926) 评论(3) 编辑
  2004年11月9日
posted @ 2004-11-09 14:50 zfphere 阅读(1737) 评论(10) 编辑
  2004年11月4日
posted @ 2004-11-04 14:31 zfphere 阅读(1632) 评论(3) 编辑
<2012年2月>
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910

昵称:zfphere
园龄:7年6个月
粉丝:1
关注:0

搜索

 
 

常用链接

随笔分类

随笔档案

相册

积分与排名

  • 积分 - 41800
  • 排名 - 2544

最新评论

阅读排行榜

评论排行榜

推荐排行榜