.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

vb to c#

Posted By:      Posted Date: August 26, 2010    Points: 0   Category :ASP.Net

I am trying to convert this code to c#. I tried to do it by hand and tried the converters on line. Just can't figure it out. Any help would be GREATLY appreciated

Imports Microsoft.VisualBasic

Public Class FormRewriterControlAdapter
    Inherits System.Web.UI.Adapters.ControlAdapter

    Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
        MyBase.Render(New RewriteFormHtmlTextWriter(writer))
    End Sub

End Class

Public Class RewriteFormHtmlTextWriter
    Inherits HtmlTextWriter

    Sub New(ByVal writer As HtmlTextWriter)
        Me.InnerWriter = writer.InnerWriter
    End Sub

    Sub New(ByVal writer As System.IO.TextWriter)
        MyBase.InnerWriter = writer
    End Sub

    Public Overrides Sub WriteAttribute(ByVal name As String, ByVal value As String, ByVal fEncode As Boolean)

        ' If the attribute we are writing is the "action" attribute, and we are not on a sub-control, 
        ' then replace the value to write with the raw URL of the request - which ensures that we'll
        ' preserve the PathInfo value on postback scenarios

        If (name = "action") Then

            Dim Context As HttpContext
            Context = HttpContext.Current

            If Context.Items("A

View Complete Post

More Related Resource Links

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend