User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,521 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,802 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 684 | Replies: 3
Reply
Join Date: Sep 2007
Posts: 69
Reputation: geetajlo is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
geetajlo geetajlo is offline Offline
Junior Poster in Training

Can we put 2 buttonlink in only 1 page

  #1  
Oct 3rd, 2007
I have a big problem i want to put 2 buttonlink in one page. Can we make it friends...
I have sent a sample just help me friends. Thanks
Attached Files
File Type: zip RegisterForm.zip (3.3 KB, 4 views)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Posts: 1,058
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Can we put 2 buttonlink in only 1 page

  #2  
Oct 3rd, 2007
archive doesn't work. Anyway, you should be able to add the two separate buttons. Just make each button call a function isntead of letting them choose what to call. Please post your code using the [ code ] brackets and we can help further.
Reply With Quote  
Join Date: Sep 2007
Posts: 69
Reputation: geetajlo is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
geetajlo geetajlo is offline Offline
Junior Poster in Training

Re: Can we put 2 buttonlink in only 1 page

  #3  
Oct 5th, 2007
Here is my work. i just want to put 2 button link that is 1 for sign in and the other for Register.



Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub btnSignIn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSignIn.Click
If txtUserName.Text = "geeta" And txtPassword.Text = "geetajlo" Then
MsgBox("Welcome geetajlo")

btnSignIn.Visible = False
HyperLink1.Visible = True

Else
MsgBox("Wrong UserName or Password")
End If
End Sub
End Class
Reply With Quote  
Join Date: Sep 2007
Posts: 1,058
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Can we put 2 buttonlink in only 1 page

  #4  
Oct 5th, 2007
Where is the second button? Is the register button HyperLink1? Anyway, I would suggest something similar to below:
'Add two buttons to your page, call them btnSignIn and btnRegister.
'Assuming you are doing this on Page_Load, use a session variable to hold someone's login status:

Sub Page_Load
  If Session("signedIn") = "True" then
    btnSignIn.Visible = false
    btnRegister.Visible = false
    'hyperlinkRegister.Visible = false
    HyperLink1.Visible = true
    'do whatever you need to here for protected page.
  else
    btnSignIn.Visible = true
    'If you are partial to the button, use the function below. If not, use a hyperlink.
    'hyperlinkRegister.Visible = true
    'hyperlinkRegister.Text = "Register"
    'hyperlinkRegister.NavigateUrl = "register.aspx"
    btnRegister.Visible = true
    'Still don't know what hyperlink1 is for :)
    HyperLink1.Visible = false
    'do whatever you need to here to protect the page.
  end if
End Sub

Sub btnSignIn_Click(S As Object, E As EventArgs) Handles btnSignIn.Click
  If txtUserName.Text = "geeta" And txtPassword.Text = "geetajlo" Then
    Session("signedIn") = "True"
    MsgBox("Welcome geetajlo")
    btnSignIn.Visible = False
    btnRegister.Visible = False
    HyperLink1.Visible = True
  Else
    MsgBox("Wrong UserName or Password. Please Try Again.")
  End If
End Sub

Sub btnSignOut_Click(S As Object, E As EventArgs) Handles btnSingOut.Click
  Session("signedIn") = ""
  'If you have a page below or if you need redirection..
  response.redirect ("logout.aspx?logout=successful")
End Sub

Sub btnRegister_Click(S As Object, E As EventArgs) Handles btnRegister.Click
  response.redirect = "register.aspx"
End Sub
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 4:13 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC