What is the difference between Server.Transfer and
Response.Redirect? Why would you choose one over the other?

Answer Posted / x

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="ModalSave.aspx.cs" Inherits="ModalSave" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Save Version</title>
<Link href="StyleSheet.css" type="text/css"
rel="stylesheet"/>
<script language="javascript" type="text/javascript">
// <!CDATA[
function Submit(){
var rb = document.forms[0].RadioButtonList1;
var myOption = -1;
for (var i=0; i< rb.length; i++)
{
if (rb[i].checked)
{
myOption = i;
//alert ("Please select Major/Minor choice");
}

}

if (myOption == -1)
{
alert ("Please select Major/Minor choice");
return false;
}

if(window.confirm("Please Confirm that you want to create
a new version"))
{
parent.emailwindow.hide();
//parent.location.replace("Entry.aspx?Save=Y");
return true;
}
else
{
return false;
}
}

function Submitnew(){
if(window.confirm("Please Confirm that you want to create
a new version"))
{
parent.emailwindow.hide();
//parent.location.replace("Entry.aspx?Save=Y");
return true;
}
else
{
return false;
}
}

function Cancel(){
parent.emailwindow.hide();
//parent.emailwindow.close();
alert("He");
//parent.location.replace("Default.aspx?Save=Y");
//parent.emailwindow.close();
//window.close();
return true;

}


// ]]>
</script>
</head>
<body class="background" bottommargin="0" leftmargin="0"
rightmargin="0" topmargin="0">
<form id="form1" runat="server" method="post"
action="modalSave.aspx">

<div class="SaveAlign" style="<%= Title %>" >
<asp:Label ID="lblSave" runat="server" Text="Save
Release" BackColor="#66B6AF" BorderColor="Teal"
BorderStyle="Solid" BorderWidth="1px"
Width="306px"></asp:Label>

<div style="<%= displayProp %>">
<table border="0" cellpadding="0" cellspacing="0"
style="margin-left:5px">
<tr>
<td align="left" class="fontclass" style="height: 30px"
><asp:Label ID="lblProject" runat="server"
Text="Projcode"></asp:Label></td>
<td align="left" class="fontclass" style="height: 30px"
><asp:Label ID="txtProject" runat="server"
></asp:Label></td>
</tr>

<tr style="margin-top:10px">
<td align="left" class="fontclass" style="height:
24px;margin-top:10px" ><asp:Label ID="lblVersion"
runat="server" Text=" Release No." Width="96px"
></asp:Label></td>
<td align="left" class="fontclass" style="height:
24px;margin-top:10px" >&nbsp;<asp:Label ID="Label5"
runat="server" Text="1.00" Width="96px" ></asp:Label>
</td>
</tr>

<tr>
<td align="left" class="fontclass" style="height:
40px"><asp:Label ID="lblDesc" runat="server" Text="Label">
Description</asp:Label></td>
<td align="left" style="height: 40px"><textarea
id="txtADesc" runat="server" cols="20" style="height: 27px"
></textarea></td>
</tr>
<tr>
<td align="left" class="fontclass" style="height: 20px">
<asp:Button ID="Button2" class="DSSbuttonStyle"
runat="server" OnClientClick="return Submitnew()"
Text="Confirm" OnClick="Button2_Click" />
</td>
<td align="left" class="fontclass" style="height: 20px">
<%-- <asp:Button ID="Button3" class="DSSbuttonStyle"
runat="server" OnClientClick="return Cancel()"
Text="Cancel"/> --%>
<input id="Button3" type="button" class="DSSbuttonStyle"
value="Cancel" onclick="Cancel()"/>
</td>
</tr>


</table>
</div>
<div style="<%= displayProp1 %>">
<table id="table2" border="0" cellpadding="0"
cellspacing="0" style="margin-left:5px;" visible="false">
<tr>
<td align="left" class="fontclass" style="height: 30px"
><asp:Label ID="Label1" runat="server"
Text="Projcode"></asp:Label></td>
<td align="left" class="fontclass" style="height: 30px"
><asp:Label ID="txtProject1" runat="server"
></asp:Label></td>
</tr>

<tr style="margin-top:10px">
<td align="left" class="fontclass" style="height:
24px;margin-top:10px" ><asp:Label ID="Label6"
runat="server" Text="Latest Release" Width="96px"
></asp:Label></td>
<td align="left" class="fontclass" style="height:
24px;margin-top:10px" >&nbsp;<asp:Label ID="Label7"
runat="server" Width="96px" ></asp:Label>
</td>
</tr>

<tr>
<td align="left" class="fontclass"><asp:Label
ID="Label3" runat="server" Text=" Release No." Width="96px"
></asp:Label></td>
<td align="left" class="fontclass"><asp:RadioButtonList
ID="RadioButtonList1" runat="server" CellPadding="0"
CellSpacing="0" Height="20px" RepeatDirection="Horizontal"
Width="119px" style="left: -5px; clip: rect(20px auto auto
auto); position: relative; top: 7px">
<asp:listitem Value="Minor">Minor</asp:listitem>
<asp:listitem Value="Major">Major</asp:listitem>
</asp:RadioButtonList>
&nbsp; &nbsp;</td>
</tr>

<tr>
<td align="left" class="fontclass" style="height:
50px"><asp:Label ID="Label4" runat="server" Text="Label" >
Description</asp:Label></td>
<td align="left" style="height: 50px"><textarea
id="Textarea1" runat="server" cols="20" style="height:
28px" ></textarea></td>
</tr>
<tr>
<td align="left" class="fontclass" style="height:
20px"><asp:Button ID="Button1" class="DSSbuttonStyle"
runat="server" OnClientClick="return Submit()"
Text="Confirm" OnClick="Button1_Click" /></td>
<td align="left" class="fontclass" style="height: 20px">
<%-- <asp:Button ID="Button4" class="DSSbuttonStyle"
runat="server" OnClientClick="return Cancel()"
Text="Cancel" /> --%>
<input id="Button4" class="DSSbuttonStyle"
value="Cancel" type="button" onclick="Cancel()"/>
</td>
</tr>

</table>
</div>
<div style="width:30px">&nbsp;</div>
</div>
</form>
</body>
</html>

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is faster union or union all?

572


What is data control in asp.net?

512


What websites use asp.net?

522


Can asp.net work on an nt server?

553


How can you use a custom controls in ASP.NET application?

542






what is DLL Hell and how it is solved in .NET? please explain clearly??

1883


What is the difference between session.abandon() vs clear()?

541


What are the page life cycle events?

493


How to you can limit Access to Web API to Specific HTTP Verb?

662


a web application needs to be created to accept the product name and quantity of a toy from a customer. After the customer has entered the product name the application needs to display the discounted price of the product to the customer (company is offering 35% discount on all products). The application should allow the customer to select the product name from a list box. and also while i'm data binding to a label with custom data binding with some declarations : "The Discounted Price is "+((System.Convert.todouble(lblprodprice.text)*(system.convert.todouble(txtqty.text)) - ((System.convert.todouble(lblprodprice.text)*(system.convert.todouble(txtqty.text)*0.35)). Where i need to give this declaration in asp.net 2.0.

1440


How would you get asp.net running in apache web servers?

539


How many types of Cookies are available in ASP.NET?

582


How many types of session state management options available in asp.net?

536


How long do session variables last?

530


How to integrate angular 8 with asp.net mvc 5? : Asp.Net MVC

494