[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

Active Mobile Form in page_load method

(Leon)

1/21/2003 10:03:00 PM

I have a mobile page contains two forms, the code as follow

<mobile:form id="welcome" runat="server" Paginate="True">
<mobile:Label id="lblmessage" runat="server"></mobile:Label></P>
<mobile:Label id="lblName" runat="server"
Font-Size="Normal">User Name :</mobile:Label>
<P><mobile:TextBox id="txtname"
runat="server"></mobile:TextBox></P>
<P><mobile:Label id="lblpassword" runat="server">Password
:</mobile:Label></P>
<P><mobile:TextBox id="txtpassword"
runat="server"></mobile:TextBox></P>
<P>&nbsp;</P>
<P><mobile:Command id="cmdok"
runat="server">Login</mobile:Command></P>
</mobile:form>
<mobile:form id="main" title="aaa" runat="server"
PagerStyle-ForeColor="Blue" ForeColor="#C0C0FF">
<mobile:Label id="lblmesg" runat="server" Alignment="Left"
ForeColor="#C0C0FF">main</mobile:Label>
<P>&nbsp;</P>
</mobile:form>

The befind code for above mobile page is follow

private void Page_Load(object sender, System.EventArgs e)
{
String customerID = Request.QueryString["uid"];
if (customerID != null)
{

if (Session["FirstTime"] != null)
{
ActiveForm = main;
}
else
{
ActiveForm = welcome;
lblmessage.Text = "Welcome";
}
}
}

private void cmdok_Click(object sender, System.EventArgs e)
{
if (txtname.Text == "hao")
{

string uName = txtname.Text ;
string uID = txtpassword.Text;
Session["FirstTime"] = true;
Session["UserName"] = uName;
string path = AbsoluteFilePath + "?uid=" +
Server.UrlEncode(uID);
Session["FirstTime"] = true;
this.RedirectToMobilePage(path);
}
}

My problem is that after user providing the login name and password
and hit the login button, I am not able to use ActiveForm to active my
second form called main, but first form welcome.
If I active form to main in method cmdok_Click, it works. But, not
working in the page_load method after checking session variables.

Thank you very much for your help.