« Previous Next »

Thread: setting action attribute of form tag without using ASP.NET 3.5 SP1

Last post 07-27-2009 2:18 PM by ruslany. 5 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 07-22-2009, 3:24 PM

    setting action attribute of form tag without using ASP.NET 3.5 SP1

     hi

    when i using rewriteModule, must set form action attribute, but i cant set this is ASP.NET 3.5.

    how to setting action attribute of form tag without using ASP.NET 3.5 SP1?

  • 07-23-2009, 5:41 PM In reply to

    • DanielVL
    • Top 75 Contributor
    • Joined on 10-07-2006, 2:00 PM
    • Redmond, WA, USA
    • Posts 109

    Re: setting action attribute of form tag without using ASP.NET 3.5 SP1

    According to .NET Reflector:

    public void set_Action(string value)
    {
        base.Attributes["action"] = HtmlControl.MapStringAttributeToString(value);
    }
    

    Where:

    internal static string MapStringAttributeToString(string s)
    {
        if ((s != null) && (s.Length == 0))
        {
            return null;
        }
        return s;
    }
    No idea if it works.

    Daniel Vasquez Lopez
    URL Rewrite Engine Developer
  • 07-24-2009, 2:56 AM In reply to

    Re: setting action attribute of form tag without using ASP.NET 3.5 SP1

    thanks daneil, But the code above do not work.

     MapStringAttributeToString is not a Member of HtmlControl...

    Another thought comes to mind does not?

     

  • 07-24-2009, 10:54 AM In reply to

    • DanielVL
    • Top 75 Contributor
    • Joined on 10-07-2006, 2:00 PM
    • Redmond, WA, USA
    • Posts 109

    Re: setting action attribute of form tag without using ASP.NET 3.5 SP1

    It is a simple method, just copy an paste it.
    Daniel Vasquez Lopez
    URL Rewrite Engine Developer
  • 07-24-2009, 11:50 AM In reply to

    Re: setting action attribute of form tag without using ASP.NET 3.5 SP1

    I do this, but........ This method is available in sp1?

    Note: I'm using the ASP.NET 3.5(No SP1)


  • 07-27-2009, 2:18 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 7:38 PM
    • Redmond, WA
    • Posts 661

    Re: setting action attribute of form tag without using ASP.NET 3.5 SP1

    The form.action attribute in .NET Framework 3.5 is only available starting from SP1. If you cannot upgrade your .NET framework, then other option you may want to try is outbound rewriting, which is available in URL Rewrite 2.0 beta. With that you can configure the outbound rule to change the form action URL in the response.

    http://ruslany.net
Page 1 of 1 (6 items)
Microsoft Communities