Geeks With Blogs
AzamSharp Some day I will know everything. I hope that day never comes.
I was using frames one was 20% and the other was 80% (Rows) and the smaller frame had a linkbutton which was used to log out the user. I implemented the code as
 
private void LinkButton1_Click(object sender, System.EventArgs e)
		{
			
			// Log out the user here 
            			
			// redirect to the login page		
			string path = "http://localhost/Default.aspx"; 
			Response.Redirect(path);

						
		}

Unfortunately the Default.aspx page always appear in the 20% frame window. And I wanted it to appear as a whole page. You can easily fix this by attaching client side javascript to the code. Add the following code in the InitializeComponent of the page.
 

this.LinkButton1.Attributes.Add("onclick","Form1.target='_parent';"); 

Update: If you are using linkbutton inside a usercontrol then use the FormID of the page which contains the userControl. Posted on Tuesday, September 13, 2005 12:15 PM | Back to top


Comments on this post: Opening page in the parent window using LinkButton

# re: Opening page in the parent window using LinkButton
Requesting Gravatar...
was searching for this tip!! :D
Left by Sadiq Kallada on Oct 30, 2005 2:28 AM

# re: Opening page in the parent window using LinkButton
Requesting Gravatar...
How to write in 2005. There is no initialize component visible
Left by Laddu on Mar 23, 2008 9:57 PM

Your comment:
 (will show your gravatar)


Copyright © Mohammad Azam | Powered by: GeeksWithBlogs.net