Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting C# code to VB 1

Status
Not open for further replies.

xcaliber2222

Programmer
Apr 10, 2008
70
US
Hello, I have this C# code I've written which I need to convert to VB. Could someone please show me this in VB?

methods in webform1.aspx.cs:
Code:
private void InitializeComponent()
		{    
			this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click);
			//this.btnSub2.Click += new System.EventHandler(this.btnSub2_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}

private void btnSubmit_Click(object sender, System.EventArgs e)
		{
			string p1 = this.txtName.Text.Replace("&","%26");
			//string p2 = this.txtLastName.Text.Replace("&","%26");
			string sln = "WebForm2.aspx?" + 
			"Name=" + p1; 
			//"&LastName=" + p2;

			Response.Redirect(sln);
		}

Page_Load method in webform2.aspx.cs:
Code:
private void Page_Load(object sender, System.EventArgs e)
		{
			this.txtBox1.Text = Request.QueryString["Name"];
			//this.txtBox2.Text = Request.QueryString["LastName"];
			foreach( string s in Request.QueryString)
			{
				Response.Write(Request.QueryString[s]);
				Response.Write("<br>");
			}
			for (int i =0;i < Request.QueryString.Count;i++)
			{
				Response.Write(Request.QueryString[i]);
				Response.Write("<br>");
			}

		}

I would appreciate any help. Thanks, Alejandro

 
Try this page.....
Just copy/paste your C# in and it will convert it for you...

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB.NET Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top