社区
C#
帖子详情
请教小问题高手问题
zhangjingcheng
2007-09-01 11:00:39
Response.Write("<script>alert('数据已经存在')</script>");
输出的时候提示不能用说/是换行符
应该怎么写?
...全文
143
8
打赏
收藏
请教小问题高手问题
Response.Write("alert('数据已经存在')"); 输出的时候提示不能用说/是换行符 应该怎么写?
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
用AI写文章
8 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
zhangjingcheng
2007-09-03
打赏
举报
回复
怎么就没人呢?
bbdog
2007-09-01
打赏
举报
回复
Response.Write(@"<script>alert('数据已经存在')</script>");//试一下下?
zhangjingcheng
2007-09-01
打赏
举报
回复
一个样子
wjg06
2007-09-01
打赏
举报
回复
Response.Write("<script>alert('数据已经存在');</script>");
zhangjingcheng
2007-09-01
打赏
举报
回复
编译器错误信息: CS1010: 常量中有换行符
行 109: {
行 110: Response.Write("数据已经存在!");
行 111: Response.Write("<script>alert('数据已经存在')</script>");
行 112: }
行 113: else
zhangjingcheng
2007-09-01
打赏
举报
回复
我是写在页面里面的
包含在<script runat="server">里面的 提示说/是换行符
不知道怎么写了
sky_97
2007-09-01
打赏
举报
回复
应该没有问题啊
zhangjingcheng
2007-09-01
打赏
举报
回复
不行啊
还是一样的错误!
<script runat="server">
private void Page_Load(Object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
ImgPreview.Visible=false;
}
}
void GetThumbnailImage(int width,int height,string strInfo,int left,int right)
{
string file = "image/" + uploadFile.PostedFile.FileName.Substring(uploadFile.PostedFile.FileName.LastIndexOf('\\') + 1);
string newfile = "image/" + uploadFile.PostedFile.FileName.Substring(uploadFile.PostedFile.FileName.LastIndexOf('\\') + 1) + ".jpg";
string strAdd=strInfo;
System.Drawing.Image oldimage = System.Drawing.Image.FromFile(Server.MapPath(file));
System.Drawing.Image thumbnailImage =
oldimage.GetThumbnailImage(width, height,new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);
Response.Clear();
Bitmap output=new Bitmap(thumbnailImage);
Graphics g=Graphics.FromImage(output);
g.DrawString(strAdd,new Font("Courier New", 14),new SolidBrush(Color.Red),left,right);
output.Save(Server.MapPath(newfile),System.Drawing.Imaging.ImageFormat.Jpeg);
Response.ContentType = "image/gif";
ImgPreview.Visible=true;
ImgPreview.ImageUrl=newfile;
Label1.Text = "生成新图片显示:";
Oldimage.Text = file;
Newimage.Text = newfile;
}
bool ThumbnailCallback()
{
return true;
}
void Button_Click(object sender, EventArgs e)
{
int width,height,left,right;
string strAddInfo=txtAddInfo.Text;
width=Int32.Parse(txtWidth.Text);
height=Int32.Parse(txtHeight.Text);
left=Int32.Parse(txtLeft.Text);
right=Int32.Parse(txtRight.Text);
if(!(uploadFile.PostedFile.ContentLength>0))
{
lblErrInfo.Text="没有选择文件!";
}
else
{
string path = Server.MapPath("./image/"+uploadFile.PostedFile.FileName.Substring(uploadFile.PostedFile.FileName.LastIndexOf('\\')+1));
if(File.Exists(path))
{
lblErrInfo.Text="已经有同名文件!";
}
else
{
uploadFile.PostedFile.SaveAs(path);
GetThumbnailImage(width,height,strAddInfo,left,right);
starimage.Text = "";
lblErrInfo.Text = "";
}
}
}
protected void starn_Click(object sender, EventArgs e)
{
if (TextBox1.Text.Trim() == "")
{
starname.Text = "信息简称不能为空!";
startext.Text = "";
starimage.Text = "";
}
else if (TextBox3.Text.Trim() == "")
{
startext.Text = "请填写下面的详细信息!";
starname.Text = "";
starimage.Text = "";
}
else if (Oldimage.Text.Trim() == "" || Newimage.Text.Trim() == "")
{
starimage.Text = "请先上传图片!";
startext.Text = "";
starname.Text = "";
}
else
{
starname.Text = "";
startext.Text = "";
starimage.Text = "";
string star1=DropDownList1.Text.ToString();
string star2 = TextBox1.Text;
string star3 = TextBox3.Text;
string Oldimages=Oldimage.Text;
string Newimages=Newimage.Text;
string starconn = "user id=sa;password=123;initial catalog=aspx;server=KEYJOB;Connect TimeOut=60";
SqlConnection conn = new SqlConnection(starconn);
conn.Open();
SqlCommand star = new SqlCommand("select * from admintext where starname='" + star2 + "'", conn);
SqlDataReader stars = star.ExecuteReader();
if (stars.Read())
{
Response.Write("数据已经存在!");
}
else
{
stars.Close();
SqlCommand starrs = new SqlCommand("insert into admintext (titleid,starname,inttime,startext,Oldimage,Newimage) values('" + star1 + "','" + star2 + "','" + System.DateTime.Now + "','" + star3 + "','" + Oldimages + "','" + Newimages + "')", conn);
SqlDataReader rs = starrs.ExecuteReader();
if (rs.Read())
{
Response.Write("数据添加成功!");
}
}
}
}
protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
starimage.Text = "";
starname.Text = "";
startext.Text = "";
TextBox3.Text = "";
TextBox1.Text = "";
Oldimage.Text = "";
Newimage.Text = "";
ImgPreview.ImageUrl = "";
ImgPreview.Visible = false;
Label1.Text = "";
}
</script>
无效的过程调用或参数: 'Instr'解决方法
以前我一直使用ASP无组件上传类来上传文件。但是今天又个客户反映说。不能上传。出现错误。,但在我电脑上测试没
问题
。后来发现客户用的是IE8 于是开始找解决方法 错误如下:Microsoft VBScript 运行时错误 错误 '800a0005' 无效的过程调用或参数: 'Instr'出错的原因,是IE7/Firefox3中,上传文件时不再包含文件在本地的完整路径,而只有文件名。这使得原有...
Oracle INSTR 用法 Oracle 字符串搜索函数 INSTR Oracle instr 函数和like模糊查询对比 Oracle INSTR 用法
Oracle INSTR 用法 Oracle 字符串搜索函数 INSTR Oracle instr 函数和like模糊查询对比 一、instr 函数 1、instr函数语法规则:instr(srcStr,targetStr ,[start_position],[num]) 2、参数介绍: srcStr: 源字符串 targetStr :目标字符串 start_position:源字符串中开始的位置,默认从头开始。 【可选参数】 num...
REGEXP_INSTR :与INSTR的功能相似
ORACLE中的支持正则表达式的函数主要有下面四个: 1 REGEXP_LIKE :与LIKE的功能相似 2 REGEXP_INSTR :与INSTR的功能相似 3 REGEXP_SUBSTR :与SUBSTR的功能相似 4 REGEXP_REPLACE :与REPLACE的功能相似 它们在用法上与Oracle SQL 函数LIKE、INSTR、SUBSTR 和REP
风声无组件上传出现"无效的过程调用或参数instr"的解决办法
今天遇到的
问题
可真多,一个
问题
解决了,另一个
问题
又冒出来了.貌似新人一个. 如题,我用的是"风声无组件上传类 2.08 Beat " 网站用主目录测试使用时一切正常,改为虚拟目录之后,就不能上传图片了. 报警内容:Microsoft VBScript 运行时错误 ’800a0005’ 无效的过程调用或参数: ’Instr’ 基本上出现在uploadclass.asp第138行然后到百度里面搜了
ORACLE结合mapper.xml讨论instr函数匹配时,若参数值长度超出了instr函数长度的限制解决方法
ORACLE结合mapper.xml讨论instr函数匹配时,若参数值长度超出了instr函数长度的限制解决方法举例如上 举例 这是一个普通的sql SELECT A.STREET_NAME,A.TYPE_NAME,A.WID,A.FILL_ID,A."NAME",A.FILL_REWARD_NAME,A.FILL_REWARD_NUM , to_number(B.FILL_PERIOD)...
C#
111,128
社区成员
642,534
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章