Hi,
you can not integrate or combine two requests in single process.
my suggestion is approach jquery or asynchronous requests.to check condition on server from client using jquery thn if true in response post required data to server .to perform "then some code"
updated Answer
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script language ="javascript" >
function savefile() {
$.post("default3.aspx?action=checkfile", { filename: document.getElementById("fileupload1").value }, function (data) {
if (data == 'Yes') {
if (confirm("Are you Sure")) {
}
}
else {
}
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="maincontent" runat="server" >
<input type ="file" id="fileupload1" />
<input type ="button" value ="Save File" id="btnsave" onclick ="savefile()" />
</form>
</body>
</html>
And code behind file contains
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["action"] != null)
{
if(Request.QueryString ["action"].ToString()=="checkfile")
{
Response.Clear();
bool execsts = true ;
if (execsts)
{
Response.Write("Yes");
}
else
{
Response.Write("File Saved Successfully");
}
Response.End();
}
}
}
This just for bring idea only
you've to modify it for your requrement.
All the Best