Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to change a hyperlink button to a regular asp.net button

Posted on 2009-04-21
2
Medium Priority
?
302 Views
Last Modified: 2012-05-06
Hello, I am maintaining some source code from a big project. One of the requirements is to replace the current Hyperlink buttons with Asp.net buttons. (<asp:Button ........etc>)

For the most part I have found this very easy to do, because I can just change the hyperlink button type to an Asp.net button type. I don't know if I am more exhauseted than I actually feel right now, but I need for someone to help me out. One .aspx page in particular in the project, appears to be different in the way it displays hyperlinked buttons.
For some reasons the hyperlink buttons that are in this particular page are different. And I don't have any idea how to change them to Asp.net type push buttons. Can someone please help me out? Attached in the code snippet below, is the existing asp.net code. You can just cut an paste it into a new .aspx web form and then view it in the visual studio IDE.

As you can see, there is a "Save" and "Cancel" hyperlinked buttons. But in the .aspx/html view I cannot see any such hyperlinked buttons? Can someone help me to figure this out?

And how do I change those "Save" and "Cancel" buttons to asp.net type buttons (Especially when I can't even see it in the .aspx markup)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" href="main.css" type="text/css" media="screen" charset="utf-8" />
<script src="menu.js" type="text/javascript"></script>
 
</head>
<body id = "twoColLayout">
 <div id= "DivContent"  >
    <form id="form1" runat="server" class="DivContent"
    style="background-repeat: repeat-y; background-attachment: scroll; background-color: EEEEEE; font-family: 'Times New Roman'; font-weight: lighter; font-style: normal;">
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
        DataKeyNames="SemesterID" DataSourceID="SqlDataSource1" DefaultMode="Insert" 
        Height="50px" Width="400px" CssClass="PagerStyle">
        <Fields>
            <asp:CommandField ShowInsertButton="True" InsertText="Save" />
        </Fields>
        <InsertRowStyle CssClass="TOP" />
        <EditRowStyle BorderStyle="None" BorderWidth="0px" CssClass="TOP" />
    </asp:DetailsView>
    </form>
    </div>
</body>
</html>

Open in new window

0
Comment
Question by:brgdotnet
2 Comments
 
LVL 9

Accepted Solution

by:
AsishRaj earned 1280 total points
ID: 24201425
Copy and paste and see if this is what you want

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" href="main.css" type="text/css" media="screen" charset="utf-8" />
<script src="menu.js" type="text/javascript"></script>
 
</head>
<body id = "twoColLayout">
 <div id= "DivContent"  >
    <form id="form1" runat="server" class="DivContent"
    style="background-repeat: repeat-y; background-attachment: scroll; background-color: EEEEEE; font-family: 'Times New Roman'; font-weight: lighter; font-style: normal;">
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
        DataKeyNames="SemesterID" DataSourceID="SqlDataSource1" DefaultMode="Insert" 
        Height="50px" Width="400px" CssClass="PagerStyle" 
        onpageindexchanging="DetailsView1_PageIndexChanging">
        <Fields>
            <asp:CommandField ShowInsertButton="True" ButtonType="Button"  InsertText="Save" />
        </Fields>
        <InsertRowStyle CssClass="TOP" />
        <EditRowStyle BorderStyle="None" BorderWidth="0px" CssClass="TOP" />
    </asp:DetailsView>
    </form>
    </div>
</body>
</html>

Open in new window

0
 
LVL 2

Author Closing Comment

by:brgdotnet
ID: 31573118
Thank you!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Integration Management Part 2
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month15 days, 13 hours left to enroll

580 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