Solved

Replace Hyperlink with "asp:Button" Functionality

Posted on 2007-12-05
1
1,050 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
1 Comment
 
LVL 1

Accepted Solution

by:
dabrat earned 125 total points
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now