Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Dim userName As String = Request.QueryString("Name")
        'MsgBox(userName)
       


        Session("id") = Session("id")
        Dim userName As String = User.Identity.Name

        Dim usr As MembershipUser = Membership.GetUser(userName)
        'Email.Text = usr.Email
        Email.Text = usr.Email
        ConfirmEmail.Text = usr.Email
        MsgBox("jhjkh")
        



        ' ConfirmEmail.Text = usr.Email



    End Sub

i have button_click function on the same page...i want that when i click on button the steps of pageload events are skipped....what shoule i do for that?

Check for Page PostBack

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
        Session("id") = Session("id")
        Dim userName As String = User.Identity.Name

        Dim usr As MembershipUser = Membership.GetUser(userName)
        'Email.Text = usr.Email
        Email.Text = usr.Email
        ConfirmEmail.Text = usr.Email
        MsgBox("jhjkh")
End If
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.