Craig Deelsnyder
4/9/2002 1:31:00 AM
I had a similar problem, which did not make sense. Make one of your fields
(textboxes, etc.) AutoPostBack=true. My problem was that if you look in the
source of the page with the problem in the browser, I had no __doPostBack()
JavaScript function (ASP.NET didn't put one in). My form's
action="logon.aspx" was submitting the form back to my page when I hit
'Submit', but since it wasn't doing a __doPostBack, my button code was never
run (no event args were sent with the request). It simply did a Page_Load
and redisplayed since I didn't want to handle a POST request type
explicitly.
Setting AutoPostBack=true for one of the fields would put it in there.
Does anyone know why, or is this there a more correct explanation/fix?
Having to do that extra server hit for the field with AutoPostBack=true is
not necessary and annoying.
"Murat UCUNCU" <m_ucuncu@hotmail.com> wrote in message
news:eKCgTjz3BHA.2816@tkmsftngp05...
> Hi,
> I have been trying to redirect all mobile page requests to a login page
for
> unauthenticated requests using Forms Authentication. After directed and
> having entered the login information in the login page, I use
> RedirectToLoginPage() method, but,nothing seems to happen. All the data I
> entered in the textbox just disappears but I still remain at the same
login
> page. Is there a way to help me out? Below is the code I used.
>
> Thanks alot
>
> Murat Ucuncu
> --------------------------------------------------------------------------
--
> ----------------------
> LOGIN.ASPX FILE
> public class MobileWebForm1 : System.Web.UI.MobileControls.MobilePage{
>
> protected System.Web.UI.MobileControls.TextBox Username; protected
> System.Web.UI.MobileControls.TextBox Password;
>
> protected System.Web.UI.MobileControls.Command CmdLogin; protected
> System.Web.UI.MobileControls.Form formauth;
>
>
>
> private void login_Click(object sender, System.EventArgs e){
>
> String RedirectURL =
> FormsAuthentication.GetRedirectUrl(Username.Text,false);
>
> if (FormsAuthentication.Authenticate(Username.Text,Password.Text))
>
> this.RedirectToMobilePage(RedirectURL);
>
> else
>
> Username.Text="ERROR!!"; }
>
> }
>
>
>
> AND WEB.CONFIG FILE .................
>
> <authentication mode="Forms">
>
> <forms name="CSGMISAuth" path="/" loginUrl="login.aspx"
protection="All"
> timeout="60">
>
> <credentials passwordFormat="Clear">
>
> <user name="user" password="password"> </user>
>
> </credentials>
>
> </forms>
>
> </authentication>
>
> <authorization> <deny users="?" /> </authorization>
>
>
>