ASP.net VB.net code to go to another page and fill out a password

Hi

What VB.net code would I use to move to another web page, add text two three text boxes and run code behind a button click on that page
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CodeCruiserCommented:
Would that be from winforms or from a webpage?

For winforms
http://www.codeproject.com/Questions/95136/automatic-web-form-filling-with-vb-net
0
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
A web page
0
Jitendra PatilSr.Software EngineerCommented:
try the below code
1 st page
.aspx code
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm4.aspx.vb" Inherits="TestWebApplication_VB.Net.WebForm4" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
       <asp:Button ID="btnpassdata" runat="server" Text="Pass Data" />
    </div>
    </form>
</body>
</html>

Open in new window

.vb code
Public Class WebForm4
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnpassdata_Click(sender As Object, e As EventArgs) Handles btnpassdata.Click
        Session("value1") = "MyDATA1"
        Session("value2") = "MyDATA2"
        Session("value3") = "MyDATA3"
        Response.Redirect("Displaydata.aspx")
    End Sub
End Class

Open in new window


2nd page
.aspx code
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Displaydata.aspx.vb" Inherits="TestWebApplication_VB.Net.Displaydata" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <table>
         <tr>
             <td>Name: </td>
             <td><asp:TextBox ID="textBox1" runat="server"></asp:TextBox></td>
         </tr>
         <tr>
           <td>Address:</td>
           <td><asp:TextBox ID="textBox2" runat="server"></asp:TextBox></td>
         </tr>
         <tr>
           <td>Phone:</td>
           <td><asp:TextBox ID="textBox3" runat="server"></asp:TextBox></td>
         </tr>
         <tr>
           <td colspan="2">
              <asp:button ID="btnsubmit" runat="server" Text="Submit" />
           </td>
         </tr>
      </table> 
    </div>
    </form>
</body>
</html>

Open in new window

.vb code
Public Class Displaydata
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not IsPostBack Then
            textBox1.Text = Session("value1")
            textBox2.Text = Session("value2")
            textBox3.Text = Session("value3")
            btnsubmit_Click(sender, e)
        End If
    End Sub

    Protected Sub btnsubmit_Click(sender As Object, e As EventArgs) Handles btnsubmit.Click
        Response.Write("Name:" & textBox1.Text & "<br> Address:" & textBox2.Text & "Phone:" & textBox3.Text & "")
    End Sub
End Class

Open in new window

hope this helps.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CodeCruiserCommented:
You will need to find a way of posting form data to the page directly as you can not use webbrowser control in ASP.NET

http://www.codeproject.com/Tips/464859/Functions-to-Post-Data-to-a-URLs-for-Posting-Instr
0
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks for the help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.