首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

怎么让TreeView1.SelectedNode.Text的值通过url传递更新首页框架中间的页面

2012-04-30 
如何让TreeView1.SelectedNode.Text的值通过url传递更新首页框架中间的页面如何让TreeView1.SelectedNode.

如何让TreeView1.SelectedNode.Text的值通过url传递更新首页框架中间的页面
如何让TreeView1.SelectedNode.Text的值通过url传递更新首页框架中间的页面
首页
<!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>
  <title></title>
  <style type="text/css">
  table
  {
border-style: dashed;
  border-width: 0px;
  padding: 0px;
  margin: 0px;
  width:100%;
height:100%;
  }
   
  .header
  {
  width:100%;
  height:10%;
  }
.left
{
width:20%;
height:80%;
}
.right
{
width:70%;
height:80%;
}


  </style>
</head>
<body>
  <table cellpadding="0" cellspacing="0" border="0">
  <tr>
  <td colspan="2" class="header">
  <iframe name="frmHeader" 
  src="header.aspx"  
  title="系统信息" width="100%" align="top" scrolling="no" frameborder="0" 
  id="Iframe1"></iframe>
  </td>
  </tr>
  <tr style="height:500px" valign="top">
  <td class="left">
  <iframe name="frmLeft" src="left.aspx" title="功能区" width="100%" align="top" 
  scrolling="no" frameborder="0" id="I1" height="500px"></iframe>
  </td>
  <td class="right">
  <iframe name="frmRight" src="Default.aspx" title="内容区" width="100%" align="top" scrolling="no" height="500px" frameborder="0" id="frmLeft"></iframe>
  </td>
  </tr>
  </table>
</body>
</html>
左页面
<!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>
  <title></title>
  <style type="text/css">
  table
  {
border-style: dashed;
  border-width: 0px;
  padding: 0px;
  margin: 0px;
  width:100%;
height:100%;
  }
   
  .header
  {
  width:100%;
  height:10%;
  }
.left
{
width:20%;
height:80%;
}
.right
{
width:70%;
height:80%;
}


  </style>
</head>
<body>
  <table cellpadding="0" cellspacing="0" border="0">
  <tr>
  <td colspan="2" class="header">
  <iframe name="frmHeader" 
  src="header.aspx"  
  title="系统信息" width="100%" align="top" scrolling="no" frameborder="0" 


  id="Iframe1"></iframe>
  </td>
  </tr>
  <tr style="height:500px" valign="top">
  <td class="left">
  <iframe name="frmLeft" src="left.aspx" title="功能区" width="100%" align="top" 
  scrolling="no" frameborder="0" id="I1" height="500px"></iframe>
  </td>
  <td class="right">
  <iframe name="frmRight" src="Default.aspx" title="内容区" width="100%" align="top" scrolling="no" height="500px" frameborder="0" id="frmLeft"></iframe>
  </td>
  </tr>
  </table>
</body>
</html>
左页面.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class left : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  {
   
  }
  protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
  {
  //组装执行URL传参的URL字符串

  string url = string.Format("Default.aspx?TreeView1.SelectedNode.Text={0}",
  this.TreeView1.SelectedNode.Text);

  //使用带有URL参数的URL执行页面跳转
  this.Response.Redirect(url);
  站点地图
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode url="" title="公安文件管理系统" description="">
  <siteMapNode url="Login.aspx" title="登陆" description="用户登陆、注销" />
  <siteMapNode url="" title="讲话类文件" description="讲话类文件" >
  <siteMapNode url="" title="部局领导讲话" description="部局领导讲话" />
  <siteMapNode url="" title="公安局领导讲话" description="公安局领导讲话" />
  <siteMapNode url="" title="公安处领导讲话" description="公安处领导讲话" />
  </siteMapNode>
  <siteMapNode url="" title="规范性文件类" description="规范性文件类" >
  <siteMapNode url="" title="上级文件" description="上级文件" />
  <siteMapNode url="" title="本处文件" description="本处文件" />
   
  </siteMapNode>
  <siteMapNode url="" title="经验材料文件类" description="经验材料文件类" >
  <siteMapNode url="" title="外局经验材料" description="外局经验材料" />
  <siteMapNode url="" title="本处经验材料" description="本处经验材料" />
   
  </siteMapNode>
  <siteMapNode url="" title="汇报材料文件类" description="汇报材料文件类" >
  <siteMapNode url="" title="述职报告" description="述职报告" />
  <siteMapNode url="" title="杂项汇报" description="杂项汇报" />
  </siteMapNode>
  </siteMapNode>
</siteMap>


[解决办法]
this.Response.Redirect(url);
改成


Page.ClientScript.RegisterStartupScript(Page.GetType(),"js","parent.frames['frmRight'].location.href='" + url + "'",true)

热点排行