这在asp.net的web方法中是不允许的 [英] this not allowed in web method in asp.net

查看:79
本文介绍了这在asp.net的web方法中是不允许的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


如何使用



ScriptManager.RegisterStartupScript(this,GetType(),showalert, alert('only alert Message');,true);



在asp.net aspx.cs文件的web方法中



我收到错误



编译错误消息:CS0026:关键字'this'在静态属性,静态方法或静态中无效字段初始化

hi
how to use

ScriptManager.RegisterStartupScript(this,GetType(), "showalert", "alert('Only alert Message');", true);

in web method in asp.net aspx.cs file

I get error as

Compiler Error Message: CS0026: Keyword 'this' is not valid in a static property, static method, or static field initialize

推荐答案

静态方法中不允许使用此关键字..

请参考此链接:静态关键字 [ ^ ]
this keyword is not allowed inside a static method..
refer this link : static keyword [^]


这篇关于这在asp.net的web方法中是不允许的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆