| | |
Open new web page with C# code behind page
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Aug 2007
Posts: 21
Reputation:
Solved Threads: 0
current code: Response.Redirect("DeviceInformation.aspx?arg=" + e.CommandArgument);
which redirects to a page with a data grid. The argument is passed into a stored proc on a database and the infor is returned in a grid.
What i want, is the same thing, but, open it in a new page.
So something like:
Response.OpenNewDamnPage("DeviceInformation.aspx?arg=" + e.CommandArgument);
but unfortunatly that does not exsist.
Thanks in advance for any help!
which redirects to a page with a data grid. The argument is passed into a stored proc on a database and the infor is returned in a grid.
What i want, is the same thing, but, open it in a new page.
So something like:
Response.OpenNewDamnPage("DeviceInformation.aspx?arg=" + e.CommandArgument);
but unfortunatly that does not exsist.
Thanks in advance for any help!
Hey
Try This
This sure will work
If it solves your problem mark the thread as solved.
Try This
C# Syntax (Toggle Plain Text)
protected void button1_Click(object sender, EventArgs e) { Response.Write("<script type='text/javascript'>window.open('NewPageUrlWithArgument.aspx','_blank');</script>"); }
This sure will work
If it solves your problem mark the thread as solved.
My Personnel Blog:dotnetworker.blogspot.com
My Company:http://www.bizpersonnel.com
Blog:http://bizpersonnel.wordpress.com
My Company:http://www.bizpersonnel.com
Blog:http://bizpersonnel.wordpress.com
Use this exactly for your case:
C# Syntax (Toggle Plain Text)
protected void button1_Click(object sender, EventArgs e) { Response.Write("<script type='text/javascript'>window.open('DeviceInformation.aspx?arg=" + e.CommandArgument + "','_blank');</script>"); }
My Personnel Blog:dotnetworker.blogspot.com
My Company:http://www.bizpersonnel.com
Blog:http://bizpersonnel.wordpress.com
My Company:http://www.bizpersonnel.com
Blog:http://bizpersonnel.wordpress.com
Dont forget to enclose your code in code tags like this:
[code=C#]
Response.OpenNewDamnPage("DeviceInformation.aspx?arg=" + e.CommandArgument);
[/code]
this will display as
[code=C#]
Response.OpenNewDamnPage("DeviceInformation.aspx?arg=" + e.CommandArgument);
[/code]
this will display as
C# Syntax (Toggle Plain Text)
Response.OpenNewDamnPage("DeviceInformation.aspx?arg=" + e.CommandArgument);
Last edited by nccsbim071; Jul 28th, 2009 at 9:34 am.
My Personnel Blog:dotnetworker.blogspot.com
My Company:http://www.bizpersonnel.com
Blog:http://bizpersonnel.wordpress.com
My Company:http://www.bizpersonnel.com
Blog:http://bizpersonnel.wordpress.com
•
•
Join Date: Aug 2007
Posts: 21
Reputation:
Solved Threads: 0
•
•
•
•
Use this exactly for your case:
C# Syntax (Toggle Plain Text)
protected void button1_Click(object sender, EventArgs e) { Response.Write("<script type='text/javascript'>window.open('DeviceInformation.aspx?arg=" + e.CommandArgument + "','_blank');</script>"); }
c# Syntax (Toggle Plain Text)
if (e.CommandName == "AssetName") { Response.Write("<script type='text/javascript'>window.open('UsageInformation.aspx?arg=" + e.CommandArgument + "','_blank');</script>"); }
I get a new blank page with the correct url!
but if i use:
c# Syntax (Toggle Plain Text)
if (e.CommandName == "AssetName") { Response.Redirect("UsageInformation.aspx?arg=" + e.CommandArgument); }
I get the page reloaded with the data.
So both ways i get the correct url:
C# Syntax (Toggle Plain Text)
http://localhost:4513/WebSite2/UsageInformation.aspx?arg=XFM_UG:#306:100099462
but unless i call the responce.redirect it will load blank. For example even if I copy that link into my browser it loads a blank page.
Very very close... any ideas?
Thanks for your help!
Last edited by kralco626; Jul 28th, 2009 at 10:19 am.
•
•
Join Date: Aug 2007
Posts: 21
Reputation:
Solved Threads: 0
I have some new information tha might help.
If i put a control such as a label as long with the gridview the label loads when I used the following:
[code]http://localhost:4513/WebSite2/UsageInformation.aspx?arg=XFM_UG:#306:100099462[code]
But the grid which is set up to a sql data source that uses the qurrey string to get data, does not load. So i wonder if the remaining problem is with the datagrid?
If i put a control such as a label as long with the gridview the label loads when I used the following:
[code]http://localhost:4513/WebSite2/UsageInformation.aspx?arg=XFM_UG:#306:100099462[code]
But the grid which is set up to a sql data source that uses the qurrey string to get data, does not load. So i wonder if the remaining problem is with the datagrid?
well, your problem was to load the page in new window.
Which you did successfully.
Did you use the page_load event of new page. Try to get the value from the query string in the page_load event and then load the gridview in the Page_Load event.
This should probably work . I will sure look over this problem.
Your problem of opening new page from the code behind was solved. So you should mark this thread as solved and start new thread.
Which you did successfully.
Did you use the page_load event of new page. Try to get the value from the query string in the page_load event and then load the gridview in the Page_Load event.
This should probably work . I will sure look over this problem.
Your problem of opening new page from the code behind was solved. So you should mark this thread as solved and start new thread.
My Personnel Blog:dotnetworker.blogspot.com
My Company:http://www.bizpersonnel.com
Blog:http://bizpersonnel.wordpress.com
My Company:http://www.bizpersonnel.com
Blog:http://bizpersonnel.wordpress.com
•
•
Join Date: Aug 2007
Posts: 21
Reputation:
Solved Threads: 0
•
•
•
•
well, your problem was to load the page in new window.
Which you did successfully.
Did you use the page_load event of new page. Try to get the value from the query string in the page_load event and then load the gridview in the Page_Load event.
This should probably work . I will sure look over this problem.
Your problem of opening new page from the code behind was solved. So you should mark this thread as solved and start new thread.

Thanks so much! I will mark that you solved it.
I did start a new thred for the remaining question of why it did not load. It is here: http://www.daniweb.com/forums/thread207422.html
Thanks so much for your help!
![]() |
Similar Threads
- Unable to open more than one web page (Windows Vista and Windows 7)
- how to open web page using perl (Perl)
- Can't open pages made in Front Page in Dreamweaver (Site Layout and Usability)
- Unable to open to the web page and very very low speed of internet. (C)
- How do I open a web page with several layers to a spacific layer? (JavaScript / DHTML / AJAX)
- Unable to open web page (Web Browsers)
Other Threads in the C# Forum
- Previous Thread: How to keep text file from user
- Next Thread: How to reflect a date in Calendar?
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array bitmap box broadcast buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms ftp function gdi+ httpwebrequest image index install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation visualstudio webbrowser windows winforms wpf xml





