Click here to Skip to main content
15,880,543 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am adding data in one page of aspx & i want to display that stored data in new window how to do that in asp.net using c# And opening the data of particular person or id how to do plz help.

i am also trying that on botton click geturl
C#
protected void geturl(object sender, EventArgs e)
{
  string strTxt = Admissiontxt.Text;
  Response.Redirect("showregistration.aspx?pk=" + strTxt);
}
Posted
Updated 24-Sep-12 21:04pm
v2

Hi,

Use javascript on button click event to open new window, like

C#
ScriptString = "<script language="javascript">";
               ScriptString += "window.open('showregistration.aspx?pk=" + strTxt  + "')";
               ScriptString += "</script>";
               ClientScript.RegisterStartupScript(this.getType(), "<msg1>", ScriptString);</msg1>


Hope this helps...

Enjoy coding...
 
Share this answer
 
Regarding popup window the above answer is fine
use the popup event of javascript or window.open(.....)


For sending and receiving parameter from page to page see below
on you button click event:

int id=1001;
Response.Redirect("ThePage_you-want-to-direct-to.aspx?id=" + id);


On the load event of the "ThePage_you-want-to-direct-to.aspx"
the page you are redirecting to add the following code:

int id1=ConvertToInt32(Request["id"]);

or use

int id1=Request.QueryString["id"].....
 
Share this answer
 
v2
you can do it in easy and simple way with Cross Page Posting[^]

addition you to do one thing more
C#
onclientclick="target='blank'"



Example :

C#
<asp:button id="Button1" runat="server" postbackurl="~/WebForm2.aspx" xmlns:asp="#unknown">
           Text="Button"  onclientclick="target='blank'"  /></asp:button>
 
Share this answer
 
you can do it in easy and simple way with Cross Page Posting[^]

addition you to do one thing more
C#
onclientclick="target='blank'"



Example :

C#
<asp:button id="Button1" runat="server" postbackurl="~/WebForm2.aspx" xmlns:asp="#unknown">
           Text="Button"  onclientclick="target='blank'"  /></asp:button>


Thanks,
Arshad
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900