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

Difference between using directive vs using statement?

510


What is a pixel url?

514


What is the difference between a cookie and a pixel?

484


Explain the difference between web user control and web custom control?

534


Explain the difference between inline and code behind - which is best in?

504






Can the unique key be null?

570


Are cookies stored on server or client?

505


What is page fragment caching?

553


What do you mean by authorization?

522


Can you dynamically assign a Master Page?

590


Where is session data stored in asp net?

515


How do I create a web form?

530


Explain how does asp page work?

576


What is viewstate parameter?

523


What is session state server?

621