http://localhost/ask_v485655494954.html
比如我的一个运行地址是这样,伪表态,但是运行出来我查看原码我的from是这样的<form method="post" action="ask_v485655494954.html?asID=485655494954" id="form1">我想让给它把这个地改了不要?asID=485655494954
想要让它样:<form method="post" action="ask_v485655494954.html" id="form1">
如何实现啊

解决方案 »

  1.   

    http://msdn.microsoft.com/zh-cn/library/ms972974.aspx注意文章的这段代码:namespace ActionlessForm {
      public class Form : System.Web.UI.HtmlControls.HtmlForm
      {
         protected override void RenderAttributes(HtmlTextWriter writer)
         {
            writer.WriteAttribute("name", this.Name);
            base.Attributes.Remove("name");        writer.WriteAttribute("method", this.Method);
            base.Attributes.Remove("method");        this.Attributes.Render(writer);        base.Attributes.Remove("action");        if (base.ID != null)
               writer.WriteAttribute("id", base.ClientID);
         }
      }
    }
      

  2.   

    自己定义一个Actionlessform类,在aspx中不再使用系统提供的form 标记namespace ActionlessForm 
    {
        
    public class Form : System.Web.UI.HtmlControls.HtmlForm 
        

            
    protected override void RenderAttributes(HtmlTextWriter writer) 
            

                
    writer.WriteAttribute( "name", this.Name);
                
    base.Attributes.Remove( "name");
                
    writer.WriteAttribute( "method", this.Method);
                
    base.Attributes.Remove( "method");
                
    this.Attributes.Render(writer); 
                
    base.Attributes.Remove( "action");
                
    if (base.ID != null) 
                    
    writer.WriteAttribute( "id", base.ClientID);
             

        

    }创建此类并对其进行编译之后,要在 ASP.NET Web 应用程序中使用它,应首先将其添加到 Web 应用程序的 References 文件夹中一:如何自定义一个Actionlessform类
    二:如何对其进行编译
    三:在web应该程序中没有references这个文件,是不是创建一个就行,麻烦高手再帮忙一下
      

  3.   

    唉,用js也行.
       $("#from1").attr("action","csdn.com");
      

  4.   

    不是web程序吗?jQuery秒杀一切前台代码...