lian_yeye 2021-04-13 09:26 采纳率: 25%
浏览 26

Uncaught ReferenceError: xx 未定义,但是前面的代码里定义了

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="log.aspx.cs" Inherits="JINDIsoft.log" %>
<!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">

    <script language="c#" runat="server">
        void loglog(object sender, EventArgs e)
        {
            string Path = @"D:\log\log.txt";
            if (!System.IO.File.Exists(Path))
            {
                System.IO.FileStream f = System.IO.File.Create(Path);
                f.Close();
                f.Dispose();
            }
            System.IO.StreamWriter f2 = new System.IO.StreamWriter(Path, true,
            System.Text.Encoding.GetEncoding("gb2312"));
            f2.WriteLine(Request["st"].ToString()); 
            f2.Close();
            f2.Dispose();
        }
    </script>



这是前面的代码

onclick="loglog" 后面的HTML控件调用这里出的问题,是不是没读到上面的代码啊?没有定义这个错误是在浏览器里面的,但是我搞不懂他为什么说我没有定义,我明明定义了的

我写在一个aspx里的,dll没法写。public加上也不行,加上static还是不行

 

  • 写回答

0条回答 默认 最新

      报告相同问题?

      悬赏问题

      • ¥15 【通信原理】为什么传信率不变?频带利用率为啥没有二倍
      • ¥15 CANOPEN SDO
      • ¥15 r语言数据集循环获取问题
      • ¥30 求佬们帮助,总是出bug,求佬们解决一下bug
      • ¥15 后端Java转换字符串传给前端,前端如何解析呢?
      • ¥15 psychopy(python为基础的)中引入cmd
      • ¥15 不知道怎么去做关于前端电子请柬
      • ¥15 Ubuntu22.04打开是tty界面。提示OOM
      • ¥15 存储过程或函数中的结果集类型变量如何使用。
      • ¥100 关于海信电视聚好看安装应用的问题