Converting VB.Net code C#

G

Guest

Hello,

I am new to .Net world and I need some help in converting VB.Net code to C#.

Public Overridable Property CaseSensitiveKeySort() As Boolean
Get
Return _caseSensitiveKeySort
End Get
Set(ByVal Value As Boolean)
_caseSensitiveKeySort = Value
End Set
End Property

Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnLoad(e) ' call the base class method
Dim script As String
string = "<script language=" & Chr(34) & "javascript" & Chr(34) & " type="
& Chr(34) & "text/javascript" & Chr(34) & ">" & vbCrLf
....................................
....................................
....................................
....................................
script &= "</script>"
Me.Page.RegisterClientScriptBlock(functionName, script)
Me.Attributes.Add("onkeypress", "return " + functionName + "(this," +
_caseSensitiveKeySort.ToString().ToLower() + ")")
End Sub

Thanks in advance
SK
 
M

Mattias Sjögren

FYI, there are online language conversion tools that can help you with
this. I bet google can help you find one. The code should look
something like this

public virtual bool CaseSenitiveKeySort
{
get [ return _caseSensitiveKeySort; }
set { _caseSensitiveKeySort = value; }
}

protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
string script = "<script language=\"javascript\"" +
"type=\"text/javascript\">\r\n</script>";
this.Page.RegisterClientScriptBlock(functionName, script);
this.Attributes.Add("onkeypress", "return " + functionName +
"(this," + _caseSensitiveKeySort.ToString().ToLower() + ")");
}


Mattias
 
G

Guest

Our Instant C# VB to C# converter produces:
public virtual bool CaseSensitiveKeySort
{
get
{
return _caseSensitiveKeySort;
}
set
{
_caseSensitiveKeySort = value;
}
}

protected override void OnLoad(System.EventArgs e)
{
base.OnLoad(e); // call the base class method
string script = null;
string = "<script language=" + (char)(34) + "javascript" + (char)(34) + "
type=" + (char)(34) + "text/javascript" + (char)(34) + ">" +
System.Environment.NewLine;

script += "</script>";
this.Page.RegisterClientScriptBlock(functionName, script);
this.Attributes.Add("onkeypress", "return " + functionName + "(this," +
_caseSensitiveKeySort.ToString().ToLower() + ")");

}

--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
C# Code Metrics: Quick metrics for C#
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top