解决方案 »
- 新人求助,请各位大虾指点下!
- 求asp.net网站域名查询代码--急,路过的大侠帮忙看看
- 异常详细信息: System.Data.OleDb.OleDbException: 操作必须使用一个可更新的查询。???????????
- 怎么使DataGrid隔行显示一种颜色背景?
- insert into 错误,在关键字 'User' 附近有语法错误 谢谢进来
- 我在DataGrid的页脚中放入了一个TextBox(用的是模板列,追加记录用),我如何得到页脚中TextBox的值呀?
- 各位高手谁有OpenPop3 源码 给我下 万分感谢!~!!!!
- 我要用asp.net和sql 2000做开发
- 各位论坛的MM门请进
- 我可以在web界面显示gridview的数据但是后台取不到大神指导下
- asp.net后台如何获得前台HTML控件的值
- ASP.NET javascript问题
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" enableSessionState="True" %>
如果是StateSever方式的。。还要改注册表。。运行 regedit → 打开注册表 → 找到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters 节点 → 将 AllowRemoteConnection 的键值设置成“1”(1 为允许,0 代表禁止)→ 设置 Port (端口号)
{
/// <summary>
/// PageBase 的摘要说明。
/// </summary>
public class PageBase :System.Web .UI .Page
{
public PageBase()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
override protected void OnInit(EventArgs e)
{
this.Init+=new EventHandler(PageBase_Init);
base.OnInit(e);
}
protected void PageBase_Init(object sender,System.EventArgs e)
{
if (Session["user"] == null)
{
string s = "<script>if(opener ==null){alert('登陆超时,请 重新登录!');top.location.href='/login.aspx';}else{opener.top.location.href='/login.aspx';window.close();}</script>";
ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script> alert('" + s + "')</script>");
return;
}
}
}
}
有关如何配置 ASP.NET 应用程序的详细消息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
--><configuration>
<connectionStrings>
<add name = "sqlserverString" connectionString = "Data Source=PC-201009081007\SQLEXPRESS;Initial Catalog=recycle;User ID=sa;Password=123" />
<add name = "oracleString" connectionString = "Data Source=10.10.2.153/orcl;Persist Security Info=True;User ID=zhaodan;Password=zhaodan;Unicode=True;" />
<!-- <add name = "oracleString" connectionString = "Data Source=XE;Persist Security Info=True;User ID=admin;Password=admin;Unicode=True;" />-->
<add name="DataSource" connectionString="XE"/>
<add name="userID" connectionString="admin"/>
<add name="Password" connectionString="admin"/>
</connectionStrings>
<system.web>
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="Documentation"/>
</protocols>
</webServices>
<compilation debug="true" targetFramework="4.0" />
<!-- <authentication mode = "Forms">
<forms name=".admin" loginUrl="/login.aspx" timeout="1" path="/"></forms>
</authentication> -->
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
<sessionState
mode="InProc"
cookieless="false"
timeout="30"
/>
</system.web>
</configuration>
<pages enableSessionState="true"/>
的配置呢?
string s = "<script>if(opener ==null){alert('登陆超时,请 重新登录!');top.location.href='/login.aspx';}else{opener.top.location.href='/login.aspx';window.close();}</script>";
ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script> alert('" + s + "')</script>");
ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script> alert('" + s + "')</script>");
{
public PageBase()
{
this.Load+=new EventHandler(Basepage_Load);
}
void Basepage_Load(Object sender,EventArgs e)
{if (Session["user"] == null)
string s = "<script>if(opener ==null){alert('登陆超时,请 重新登 录!');top.location.href='/login.aspx';}else{opener.top.location.href='/login.aspx';window.close();}</script>";
ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script> alert('" + s + "')</script>");
return;}
}
直接这样试试吧 我今天也遇到这种问题 刚好搜到你的帖子 但是我的解决了 就这样写的 与webconfig没关系 代码语法可能有问题 你自己看看吧 祝你要用哦
this.Init+=new EventHandler(PageBase_Init);
将Init改为Load就可以了
this.Load
最后发现用ashx总报这个错
public class DeleteAjax : IHttpHandler, System.Web.SessionState.IRequiresSessionState
加了个引用就好了