|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Hyperlink ControlI am a newcomer in the asp .NET c# area. I really need some help here. I have two web page DEFAULT.ASPX and JOBCATEGORY.ASPX. Inside the DEFAULT.ASPX there are some webparts. There is a hyperlink control in one of the webparts that I generate using the following codes, HyperLink h02 = new HyperLink (); h02.Controls.Add ( UpdateImage ); h02.Attributes.Add ("target", "_blank" ); h02.Attributes.Add ("cursor", "hand"); h02.NavigateUrl = URL1; where URL1 = "http://localhost/jobcategory.aspx" cell.Controls.Add ( h02 ); row.Cells.Add ( cell ); webPartDataTable.Rows.Add ( row ); The result, when I click the above hyperlink control it redirect to a new window jobcategory.aspx, that actually I don't want to have it. I prefer to get the same window, closing the default.aspx and after that showing up the job category.aspx in the same window. Is there anyone who could help me to get what I want? Hi Chandra,
I'm not sure why the page is opening in a new window, but you can try to add an attribute to your hyperlink object. h02.Attributes.Add("target","_self"); (or try with _top to escape from any frames) HTH Altaf -------------------------------------------------------------------------------- All that glitters has a high refractive index. www.mendhak.com Show quoteHide quote "chandra" <chan***@discussions.microsoft.com> wrote in message news:C841446C-F1DB-47B9-AC74-60727E0FC2C8@microsoft.com... > Hi, > I am a newcomer in the asp .NET c# area. I really need some help here. > > I have two web page DEFAULT.ASPX and JOBCATEGORY.ASPX. > Inside the DEFAULT.ASPX there are some webparts. > > There is a hyperlink control in one of the webparts that I generate using > the following codes, > > HyperLink h02 = new HyperLink (); > h02.Controls.Add ( UpdateImage ); > h02.Attributes.Add ("target", "_blank" ); > h02.Attributes.Add ("cursor", "hand"); > h02.NavigateUrl = URL1; where URL1 = "http://localhost/jobcategory.aspx" > cell.Controls.Add ( h02 ); > row.Cells.Add ( cell ); > webPartDataTable.Rows.Add ( row ); > > The result, when I click the above hyperlink control it redirect to a new > window jobcategory.aspx, that actually I don't want to have it. I prefer > to > get the same window, closing the default.aspx and after that showing up > the > job category.aspx in the same window. > > Is there anyone who could help me to get what I want? >
Error in DataList test query - aspnet 2.0
getting Membership userid to use and store in a custom database Gridview Updates not writing to database after clicking update General Event Handler For Runtime Buttons Dynamically Adding DataLists Custom DropDownList Control and ListItem Sorting only certain columns in datagrid GridView DataFormatString not formatting how to handle multiple events from a control collection? How can I let the user resize the Multipage or PageView? |
|||||||||||||||||||||||