Click to See Complete Forum and Search --> : Need helps with Button server control
Martin_SBT
July 25th, 2006, 04:05 PM
Ok i have been spending days figuring this out so the one that will help me fix that will be my idol!!!!!!!!!! :)
I am building my asp.net project in VS2003 using VB.net
I got two forms: my startup form is used to logon to my project so it just contains Username and Password fields and a submit button. When clicking on the submit button, if password (and username) are valid i make a server.transfer to my second form that contains some texbox fields and a server control button. When i click on the button on my second form, instead of executing the code i wrote for the onClick event, it seem to execute ny logon form! (???????) what am i missing??? Please help me to understand why it is doing that
thanks in advance
Martin
jasonli
July 25th, 2006, 04:11 PM
the problem is you used Server.Transfer. Try Response.Redirect.
Why do not use formsauthentication?
Martin_SBT
July 25th, 2006, 04:16 PM
the problem is you used Server.Transfer. Try Response.Redirect.
Why do not use formsauthentication?
Hi Jasonli
I was suspecting server.transfer to cause that problem so i did tested using response.redirect and it does the exact same thing!! (??)
What will be the benefits for me to use form authentication? I am not loging on to a web site or anything like that. My app actually logon to a third party software using an avalaible API. So my logon form send the username and password to the API and if they are valid then i do a server.transfer (or response.redirect that i just tested)
jasonli
July 25th, 2006, 04:39 PM
At least, if you use FormsAuthentication, after user logs out he can't access second webpage any longer until he logs back in.
I am not sure what your problem exactly is. Because there is only one button server control, that button is actually submit button.
You can post your code if you want. Maybe I could find something.
Martin_SBT
July 25th, 2006, 04:42 PM
Actually i have more that one button on my second form. I didnt say anything about it cause i ddint know it was making any difference.
what part of my code are you interested in? i got a lot...
now where can i find infos on form authentifications?
jasonli
July 25th, 2006, 04:51 PM
Go to http://msdn2.microsoft.com/en-us/library/xdt4thhy.aspx
Martin_SBT
July 25th, 2006, 05:14 PM
that still doesnt explain why when i click on a button of my second form it take me back to my logon form????
Anybody can help me understanding why it is doing that??
Martin_SBT
July 26th, 2006, 07:37 AM
Anyone please? :cry:
When i click on my button on the second form, instead of executing the code of the On Click event it fire up my 1st form! Anyone can explain me why?
Thanks
jasonli
July 26th, 2006, 08:09 AM
When you click the button, the first part of code that will run should be Page_Load. Did you check that part?
Martin_SBT
July 26th, 2006, 08:50 AM
I Just learned something new! Thanks so much Jasonli!!!
In my page-load event i had a server.transfer to my main form! I am learning asp.net slowly and i didnt know that when i click a button on my webform, the page_load of that form will fire!!!
I will never thank you enough!!
many thanks
Martin :) :) :)
jasonli
July 26th, 2006, 12:13 PM
That's all right.
Actually we all are learning how to program.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.