http://www.12342234.cn/index.html   是静态网页
http://www.12342234.cn/index.aspx  可以生成静态页面(我生成静态页面的原理 就是运行idnex.aspx),现在 在index.aspx中插入了yahoo的搜索代码(带有Form)  每次一提交 就提交到http://www.12342234.cn/index.aspx 中了 ,无法实现 yahoo的功能 希望帮我  解决这个大问题 
http://www.12342234.cn/index.aspx  登陆看看就明白了

解决方案 »

  1.   

    表单不存在嵌套的问题.不管哪种WEB技术都是这样的.
    你的设计有问题.
      

  2.   

    不写yahoo的搜索代码的时候  就一个表单写yahoo搜索代码   在源代码  就能看见两个 表单   当提交  搜索内容的时候就出现了  action的问题  这是个事实的问题 希望帮忙解决
      

  3.   

    不写yahoo的搜索代码的时候  就一个表单写yahoo搜索代码   在源代码  就能看见两个 表单   当提交  搜索内容的时候就出现了  action的问题  这是个事实的问题 希望帮忙解决
      

  4.   

    改改yahoo的代码就好了,form是不能嵌套的,把yahoo的代码改成下面的,效果是一模一样的:<script language="javascript" type="text/javascript">
                function yahooSearch(){
                    url = "http://search.union.yahoo.com.cn/click/search.htm?m=419326&b=&p=1006&a=&st=0&fw=union&name=";   
                    obj = document.getElementById('searchName');
                    if (obj.value == '请输入关键字'){ 
                        obj.focus(); 
                        obj.value = ''; 
                        return false; 
                    }
                    
                    url = url + encodeURIComponent(obj.value);
                    window.open(url);
                }
            </script>
            
    <input id="searchName" name="name" type="text" style="width:210px; *margin-right:.5em; " value="请输入关键字" onMouseOver="this.focus()" onBlur="if (value ==''){value='请输入关键字'}" onFocus="this.select()" onClick="if(this.value=='请输入关键字')this.value=''"/>
    <input type="button" onclick="yahooSearch();" value="搜索" />
      

  5.   

    http://www.12342234.cn/Index.html
    http://www.12342234.cn/Index.aspx上这两个代码 就明白了
      

  6.   

    <div style="width:147px;">
    <div style="height:27px; zoom:1; background:url(http://cn.yimg.com/p/un/070803/bg.gif) bottom repeat-x #fff; border:1px solid #ccc; width: 276px;">
    <div style="margin:10px 0 0 5px; float:left; display:inline;">
    <a href="http://search.cn.yahoo.com" target="_blank">
    <img src="http://cn.yimg.com/p/un/070803/ylg.gif" alt="雅虎" border="0" /></a></div><div style="float:left; margin:7px 0 0 10px;">
    <form action="http://search.union.yahoo.com.cn/click/search.htm?" method="get" style="margin:0; padding:0;" target="_blank" onsubmit="if (this.name.value == '请输入关键字') 
    { this.name.focus(); this.name.value = ''; return false; }">  <input name="name" type="text" style="width:210px; *margin-right:.5em; " value="请输入关键字" onMouseOver="this.focus()" onBlur="if (value ==''){value='请输入关键字'}" onFocus="this.select()" onClick="if(this.value=='请输入关键字')this.value=''"/>
      <button type="submit" style="padding:0 .3em">搜索</button>
      <input name=m type=hidden value="419326">
      <input name=b type=hidden value=""> 
      <input name=p type=hidden value="1006">
      <input name=a type=hidden value=""> 
      <input name=st type=hidden value="0">
      <input name=fw type=hidden value="union"> 
      </form>
    </div>
    </div>
    </div>是yahoo的源代码! 
      

  7.   

    用我的方法能实现你的功能,和yahoo的代码实现的效果是一样的
      

  8.   

    哦 我看见了 是一样的!  那也能给带来收益吗?谢谢你 !  高手就是高手阿 你去这里 作个
    http://community.csdn.net/Expert/topic/5766/5766600.xml?temp=.6927149
    给分  能给我讲讲 怎么想到这个的吗?我本来的 程序为什么不行 ,  如果你做生成静态页面你 又会怎么做 
    QQ 46941598
    MSN [email protected]
      

  9.   

    <form action="http://search.union.yahoo.com.cn/click/search.htm?" method="get" style="margin:0; padding:0;" target="_blank" onsubmit="if (this.name.value == '请输入关键字')
    { this.name.focus(); this.name.value = ''; return false; }"><input name="name" type="text" style="width:210px; *margin-right:.5em; " value="请输入关键字" onMouseOver="this.focus()" onBlur="if (value ==''){value='请输入关键字'}" onFocus="this.select()" onClick="if(this.value=='请输入关键字')this.value=''"/>
    <button type="submit" style="padding:0 .3em">搜索</button>
    <input name=m type=hidden value="419326">
    <input name=b type=hidden value="">
    <input name=p type=hidden value="1006">
    <input name=a type=hidden value="">
    <input name=st type=hidden value="0">
    <input name=fw type=hidden value="union">
    </form>
    --------------------------------
    其实上面yahoo代码就是在提交表单的时候用get方式取请求http://search.union.yahoo.com.cn/click/search.htm页面,而get方式就是把参数放啊url中(yahoo所需要的参数就是那些input组合出来的),既然是把参数放在url,我们就可以自己组合url,然后直接打开这个url就行,这样就跟get方式请求是一样的效果,所以我们就组合url成这样:
    url = "http://search.union.yahoo.com.cn/click/search.htm?m=419326&b=&p=1006&a=&st=0&fw=union&name="; 
    前面的m,b,p等参数都是写死的参数,对应yahoo代码中的隐藏域中的值,最后的name参数就是用户输入的搜索关键词。你本来的 程序为什么不行,是因为你把yahoo的form直接嵌套到你自己的form中,form是不能嵌套的,所以默认会请求最外层的form。
      

  10.   

    如果你做生成静态页面你 又会怎么做,
    ----------------------------
    直接把我的代码放在静态页面中就好了,因为的代码并没有form表单,所以放在如何位置都可以
      

  11.   

    谢谢你  还向麻烦你一件事情 我在index.aspx.cs 中用的是
     protected override void Render(HtmlTextWriter writer)
        {
            System.IO.StringWriter html = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter tw = new HtmlTextWriter(html);
            base.Render(tw);
            System.IO.StreamWriter sw = new System.IO.StreamWriter(Server.MapPath("index.html"), false, System.Text.Encoding.UTF8);
            sw.Write(html.ToString());
            sw.Close();
            tw.Close();
            Response.Write("<script>alert('已经生成静态页面Index.html');</script>");
            Response.Write("<script>window.location.href =('admin_/main.aspx');</script>");
        }
    来生成静态页面 
    每次都是运行 这个aspx 才生成的 index.html
    1、不知道 成熟的 办法是怎么做 生成静态页面 2、希望求各代码  怎么生成静态页面。
      

  12.   

    那想想什么时候生成html代码,你的需求是什么。
      

  13.   

    用户更新数据后 点生成静态页面  就生成一个index.html现在 我用的方法是点Button 浏览 http://www.12342234.cn/idnex.aspx  就执行生成html老板说 这么做不规范,  我不知道规范的应该怎么做!  
    只是生成首页(index.aspx) 为静态就可以.
      

  14.   

    直接在点击button的时候就生成不就行啦,为什么要点击button的时候去浏览http://www.12342234.cn/idnex.aspx页了?
      

  15.   

    protected override void Render(HtmlTextWriter writer)
        {
            System.IO.StringWriter html = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter tw = new HtmlTextWriter(html);
            base.Render(tw);
            System.IO.StreamWriter sw = new System.IO.StreamWriter(Server.MapPath("index.html"), false, System.Text.Encoding.UTF8);
            sw.Write(html.ToString());
            sw.Close();
            tw.Close();
            Response.Write("<script>alert('已经生成静态页面Index.html');</script>");
            Response.Write("<script>window.location.href =('admin_/main.aspx');</script>");
        }-----------------------------------------------------------
    我目前的水平只会   浏览一个网页生成  这个网页的静态不知道你说的方法怎么实现 ,点Button  生成 静态 
    http://www.12342234.cn/index.aspx
      

  16.   

    你点击button不是会引发1个后台事件吗,在后台事件中写你生成静态页面的代码。
    PS:下午有点事,所以回的比较慢
      

  17.   

    System.IO.StringWriter html = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter tw = new HtmlTextWriter(html);
            base.Render(tw);
            System.IO.StreamWriter sw = new System.IO.StreamWriter(Server.MapPath("index.html"), false, System.Text.Encoding.UTF8);
            sw.Write(html.ToString());
            sw.Close();
            tw.Close();
            Response.Write("<script>alert('已经生成静态页面Index.html');</script>");
            Response.Write("<script>window.location.href =('admin_/main.aspx');</script
    ------               ---------------------
    怎么指向  那个index.aspx网页呢,
      

  18.   

    希望你能告诉我  怎么做 点Button 就可以执行一段代码  使得index.aspx-->>index.html
      

  19.   

    你的button不是服务器端控件吗?服务器控件不是有事件的吗,如果你的是html的按钮就不行?
      

  20.   

    asp.net 单页中【不用】(虽然能用)多个 form 提交
      

  21.   

    AK-47   我没有做静态的模版  怎么操作  我现在是有index.aspx 想把它变为index.html
      

  22.   

    AK-47   我没有做静态的模版  怎么操作  我现在是有index.aspx 想把它变为index.html
      

  23.   

    希望你能告诉我 怎么做 点Button 就可以执行一段代码 使得index.aspx-->>index.html
    -----------------------------------------是我没看清楚,原来你是要根据index.aspx页面上的东西来生成index.html,所以直接点击button不能实现,你必须打开你的index.aspx才能生成index.html。不过你不一定要跳转到index.aspx页面去生成,你可以在你点击Button的页面嵌入1个iframe,然后让这个iframe去加载index.aspx就行了
      

  24.   

    关于这个静态页面的 问题:首页登陆用的是 ajax  后台生成静态页面(html)后 有的时候  在另外一台机器上 就能看见 html上面的 您好某某会员(显示已登陆)-----------------------------
    什么方法可以避免  把用户信息生成静态页面里。