In the PageLoad event of the form, I cannot refer to server-side control within the input template. What am I missing. Therefore, when I log in, I will show the control text box, otherwise I will show the text as "please log in to do soso .."
Please, help..
you can use the FindControl method for your loginview control to get them ...
TextBox t = (TextBox)LoginView2.FindControl("TextBox1"); string s = null; if (t != null) { // textbox is in the current scope of the LoginView s = t.text; } else { // the textbox is not in the current scope of the LoginView. }
, LoginView. , , , , FindControl .
- , . , , "DropDownList1", loggedInView. , FindControl DropDownList, NEW-:
DropDownList d = (DropDownList)ucLogin.FindControl("DropDownList1"); bool answer = d.SelectedValue.StartsWith("S"); if (answer == true) { Response.Redirect("~/MemberPages/ChangePassword.aspx"); }
, "S".
, , !