Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP:NET
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
protected void geturl(object sender, EventArgs e)
{
  string strTxt = Admissiontxt.Text;
  Response.Redirect("showregistration.aspx?pk=" + strTxt);
}
Posted 24-Sep-12 22:03pm
Edited 24-Sep-12 22:04pm
JF201553.4K
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
Use javascript on button click event to open new window, like
 
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...
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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"].....
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

you can do it in easy and simple way with Cross Page Posting[^]
 
addition you to do one thing more
onclientclick="target='blank'"
 

Example :
 
 <asp:button id="Button1" runat="server" postbackurl="~/WebForm2.aspx" xmlns:asp="#unknown">
            Text="Button"  onclientclick="target='blank'"  /></asp:button>
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

you can do it in easy and simple way with Cross Page Posting[^]
 
addition you to do one thing more
onclientclick="target='blank'"
 

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

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

  Print Answers RSS
0 DamithSL 405
1 OriginalGriff 245
2 Sergey Alexandrovich Kryukov 207
3 Peter Leow 185
4 Afzaal Ahmad Zeeshan 154
0 OriginalGriff 7,460
1 DamithSL 5,519
2 Sergey Alexandrovich Kryukov 4,954
3 Maciej Los 4,936
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 3 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100