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

How can I open ashx file in mobile?

823


Who is using asp.net?

672


Explain exception filters?

759


What are the different authentication modes in asp.net?

708


What is .net framework and what are the main components of it?

560


Which control has default post back is enabled(true)?

794


Explain about the .NET framework?

804


Is there any limit for query string? Means what is the maximum size?

688


Describe in brief .net framework and its components.

734


How long does an http session last?

680


What is the caspol.exe tool used for?

732


What is smpte vc-1?

756


How can we register exception filter globally?

756


How do sessions work?

699


List the advantages and disadvantages of user control an custom control?

720