

I have a LinkButton in the masterpage and when I click LinkButton I redirect, say, Page1.aspx . On page1.aspx, I have button1 . When I click this button1 I open a new window without affecting the Page1.aspx data.
But when I click on the LinkButton main page, redirecting to Page1.aspx and from the code behind, the data of button1 , Page1.aspx .
How to prevent this. I provide my code.
LinkButton on the main page:
<asp:LinkButton ID="lnkAppointMent" runat="server" OnClick="lnkAppointMent_Click"><span>Appointment Scheduler </span></asp:LinkButton>
Click LinkButton Event:
protected void lnkAppointMent_Click(object sender, EventArgs e) { Session["PhoneCenter"] = "Appointment"; Response.Redirect("PhoneMessage.aspx"); }
PageLoad redirect page (PhoneMessage.aspx):
protected void Page_Load(object sender, EventArgs e) { fillCustomTypeMessages(); if (!Page.IsPostBack) { . . . else if (Session["PhoneCenter"].ToString() == "Appointment") { btnScheduleAppointments_Click(btnScheduleAppointments, null); } . . .
Button on PhoneMessage.aspx:
<div style="float: right; padding-right: 120px"> <asp:Button ID="btnScheduleAppointments" runat="server" OnClick="btnScheduleAppointments_Click" CssClass="button" Text="Schedule Appointments" ToolTip="Open appointment scheduler" /> </div>
RaisPostBack on PhoneMessage.aspx:
protected override void RaisePostBackEvent(IPostBackEventHandler source, string eventArgument) { try { base.RaisePostBackEvent(source, eventArgument); } catch (Exception ex) { } . .
ps: when I click btnScheduleAppointment , the source will be Schedule Appointments , and if I lnkAppointMent , the source will be <span>Appointment Scheduler </span> , even if I call btnScheduleAppointment when I click lnkAppointMent .
Click the button event:
protected void btnScheduleAppointments_Click(object sender, EventArgs e) { if (!Permissions.checkPermissions(Session["employeeloggedin"].ToString(), "PHMSGVMD")) { ScriptManager.RegisterStartupScript(this, Page.GetType(), "OnLoad", "alert('You must have the Phone Messages: View and Modify permission to schedule appointments!')", true); } else { string script = String.Format("openNewWin('" + "phonescheduler.aspx" + "')"); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "openNewWin", script, true); } }
Script:
function openNewWin(url) { alert(url); var open_link = window.open('', '_blank'); open_link.location = url; }
Any clarification needed. Please comment.