hi,
first i am creating home page i.e., home.aspx in that page i place two image buttons one for new user Registration i.e., Register and next one is Login imagebutton.
and i am taking another page page i.e., Login.aspx in this page i am taking multiview, in that multiview i write 2 views for login and new user Register.
View1 for login and View2 for new user Register. my aim is if user click Register image button in home.aspx page that time View2 is displayed in login.aspx page.
How to write code for this. please give a solution
Thanks.
Loading
Deepak BhatiaPosted Aug 9, 2010, 1:35 AM
I would suggest not to use image button rather use hyperlink as it would not post the contents back to your home.aspx page
This is code side for home.aspx page
<asp:Label ID="lblContent" runat="server">asp:Label>
<a href="Login.aspx?click=1" id="hlNewRegisteration">
<img id="RegisterImage" src="imagePathOfYourRegisterImage" />a> <a href="Login.aspx?click=2"
id="hlLogin">
<img id="Img1" src="imagePathOfYourLoginImage" />a>
This is placed in Login.aspx page
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="LoginView" runat="server">
asp:View>
<asp:View ID="NewRegistrationView" runat="server">
asp:View>
asp:MultiView>
Now in page load event of Login.aspx page write this code,
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Params["click"].ToString() == "1")
{
MultiView1.ActiveViewIndex = 1;
}
else
MultiView1.ActiveViewIndex = 0;
}
Madhu KPosted Aug 6, 2010, 6:06 AM
Response.Redirect("Login.aspx?Register=1");
//Login.aspx page load event
if (Request.QueryString["Register"] != null)
{
// your code in here... view2 visible true
}
Koteswararao MallisettiPosted Aug 6, 2010, 5:40 AM