Solved

Replace Hyperlink with "asp:Button" Functionality

Posted on 2007-12-05
1
1,057 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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 …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

733 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