Solved

Replace Hyperlink with "asp:Button" Functionality

Posted on 2007-12-05
1
1,058 Views
Last Modified: 2012-08-14
I need to replace the two attached code snippets with asp:buttons instead of an <a href> tag but still maintain the functionality:

These do 2 simple processes:

1- a hyperlink to close the current window
2- a hyperlink to pass a querystring to another web page url

Can anyone help?

<asp:TableRow runat="server">
                <asp:TableCell ID="TableCell1" HorizontalAlign="left" runat="server">
                <a href="ContactBookForm.aspx?CID=-1">Add New</a>
				</asp:TableCell>
				<asp:TableCell runat="server">
                    <a href="javascript:window.close();">Close Window</a>
				</asp:TableCell>
            </asp:TableRow>

Open in new window

0
Comment
Question by:jtrapat1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
dabrat earned 125 total points
ID: 20419629
hello, you could just create the buttons and add code to the Click events like below --

  protected void Button1_Click(object sender, EventArgs e)
        {
            string url = "PageTwo.aspx?CD-1"; // pass a querystring to another web page url
            Response.Redirect(url);
        }

        protected void Button2_Click(object sender, EventArgs e) // closes window
        {
            Response.Write("<script language='javascript'> { self.close() }</script>");
        }


HTH
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question