VS2008中如何跳转到指定的页面?

fxyuan 2011-02-24 01:22:44
Message ms = new Message();
ms.ShowMessage("您没有权限删除进行此页面!",this.Page);

后面的this.Page如果要换成指定的页面,这个如何实现.谢谢!
...全文
247 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
ycproc 2011-02-24
  • 打赏
  • 举报
回复
Form b = new Form();
b.show();
ycproc 2011-02-24
  • 打赏
  • 举报
回复
貌似是 Winform啊
fxyuan 2011-02-24
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 fxyuan 的回复:]
引用 8 楼 tao145 的回复:
C# code
Response.Write("<script>alert('您没有权限');window.location.href='xxxx.aspx'</script>")


这个加哪呀?
[/Quote]
按照你的方法搞定,谢谢!
回头是岸 2011-02-24
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 fxyuan 的回复:]
引用 10 楼 hualilihua 的回复:
C# code
重载呗
public void ShowMessage(string strMessage, string url)
{
page.ClientScript.RegisterClientScriptBlock(page.GetType(), "", " <script>alert('" + strMessage + "');……
[/Quote]

那就用confirm呗
public void ShowMessage(string strMessage, Page page,string url)
{
page.ClientScript.RegisterClientScriptBlock(page.GetType(), "", " <script>if(Confirm('" + strMessage + "'))location href='Default.aspx'; else location.href='" + url + "'; </script>");
}
牛拦织女 2011-02-24
  • 打赏
  • 举报
回复
fxyuan 2011-02-24
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 tao145 的回复:]
C# code
Response.Write("<script>alert('您没有权限');window.location.href='xxxx.aspx'</script>")
[/Quote]

这个加哪呀?
fxyuan 2011-02-24
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 hualilihua 的回复:]
C# code
重载呗
public void ShowMessage(string strMessage, string url)
{
page.ClientScript.RegisterClientScriptBlock(page.GetType(), "", " <script>alert('" + strMessage + "');location.href='" + u……
[/Quote]
如果我想达到是系统调出"您没有权限删除进行此页面",按"确定"后再回到default.aspx这个页面里呢?
该在原来的代码上如何修改??
回头是岸 2011-02-24
  • 打赏
  • 举报
回复
重载呗
public void ShowMessage(string strMessage, string url)
{
page.ClientScript.RegisterClientScriptBlock(page.GetType(), "", " <script>alert('" + strMessage + "');location.href='" + url + "'; </script>");
}
子夜__ 2011-02-24
  • 打赏
  • 举报
回复
你的是WINFORM 还是WEB?
笑道江湖情 2011-02-24
  • 打赏
  • 举报
回复
Response.Write("<script>alert('您没有权限');window.location.href='xxxx.aspx'</script>")
ycproc 2011-02-24
  • 打赏
  • 举报
回复
 page.ClientScript.RegisterClientScriptBlock(page.GetType(), "", " <script>alert('" + strMessage + "'); </script>");
}
fxyuan 2011-02-24
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 net_lover 的回复:]
Message是你自己定义的方法,看它的代码
[/Quote]

都在这
public class Message
{
private Page mPage;
private string str_Message;

public Message()
{

}

public Message(string strMessage, Page page)
{
mPage = page;
str_Message = strMessage;
}

public void ShowMessage(string strMessage, Page page)
{
page.ClientScript.RegisterClientScriptBlock(page.GetType(), "", " <script>alert('" + strMessage + "'); </script>");
}

public void ShowMessage()
{

mPage.ClientScript.RegisterClientScriptBlock(mPage.GetType(), "", " <script>alert('" + str_Message + "'); </script>");
}
}
fxyuan 2011-02-24
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 wuyq11 的回复:]
ShowMessage怎么写的
alert('');location.href=''
[/Quote]

不明白,我是菜菜鸟.

fxyuan 2011-02-24
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 net_lover 的回复:]
一般会定义成
ms.ShowMessage("您没有权限删除进行此页面!","xx.aspx");
[/Quote]

报错
错误 2 与“Message.ShowMessage(string, System.Web.UI.Page)”最匹配的重载方法具有一些无效参数
错误 3 参数“2”: 无法从“string”转换为“System.Web.UI.Page”
wuyq11 2011-02-24
  • 打赏
  • 举报
回复
ShowMessage怎么写的
alert('');location.href=''
孟子E章 2011-02-24
  • 打赏
  • 举报
回复
一般会定义成
ms.ShowMessage("您没有权限删除进行此页面!","xx.aspx");
孟子E章 2011-02-24
  • 打赏
  • 举报
回复
Message是你自己定义的方法,看它的代码

62,041

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧