473,480 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Converting VB.Net code C#

Sai
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

Sep 12 '06 #1
2 3652

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

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Sep 12 '06 #2
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#
"Sai" wrote:
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
Sep 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
3844
by: Armand Karlsen | last post by:
I have a website ( http://www.zen62775.zen.co.uk ) that I made HTML 4.01 Transitional and CSS compliant, and I'm thinking of converting it into XHTML to learn a little about it. Which XHTML variant...
8
5711
by: prabha | last post by:
Hello Everybody, I have to conert the word doc to multiple html files,according to the templates in the word doc. I had converted the word to xml.Also through Exsl ,had finished the multiple...
5
2490
by: Robert | last post by:
I have a series of web applications (configured as separate applications) on a server. There is a main application at the root and then several virtual directories that are independant...
3
2398
by: Mary | last post by:
Hi, Does anyone know of any software out there that would convert an application written in VBScript to either VB.NET or C#/C++ quite quickly for me, or will I have to re-write the application...
3
2463
by: Parvesh | last post by:
hi, I am using a webservice which Returns the Result in an XML string, The XML response i get i svery cumbersome to parse, But if i could convert it to the Corresponding Class using the...
12
3127
by: Frederik Vanderhaeghe | last post by:
Hi, I have a problem converting text to a double. Why doesn't the code work: If Not (txtdocbedrag.Text = "") Then Select Case ddlBedrag.SelectedIndex Case 0 Case 1
4
3170
by: gg9h0st | last post by:
i'm a newbie studying php. i was into array part on tutorial and it says i'll get an array having keys that from member variable's name by converting an object to array. i guessed "i can...
7
2474
by: Coleen | last post by:
Does anyone have any good detailed information on the conversion process? We are in the process of converting 2 projects from 2003 to 2005 and have some conversion errors that I can not find...
10
1950
by: Ron | last post by:
I want to calculate the surface area of a sphere from an inputed radius with option strict on. I guess I am not converting something correctly. Here is what I am doing: I have a textbox...
4
3579
by: screamer81 | last post by:
Hello, I've a SDK functions description for a scanner and I try to convert unmanaged DLL C++ functions to c#. I converted all except one of them. This function is getting a struct parameter. ...
0
7048
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6911
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7050
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6743
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5344
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4787
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2999
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.