Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET SQL
hi,
I using Following code for redirecting a page to another window
protected void grdview_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "site")
{
string url = "http://" + e.CommandArgument.ToString();
Response.Write("<script>window.open('" + url + "' );
}
}
now it shows the site name in address bar
BUT I WANT TO GET THE IP ADDRESS (OF OPEND SITE) IN ADDRESS BAR OF THE WINDOW. WHICH IP ADDRESS SAVED IN MY SQL DB.
Plz Help Me
Thanks in advnc
Posted 23-Mar-13 1:16am
Edited 24-Mar-13 21:39pm
v4
Comments
Shanu2rick at 23-Mar-13 6:44am
   
do you already have the ip address stored in your database?
manjujasmine at 24-Mar-13 23:24pm
   
Yes i have
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Your e.CommandArgument property should return IP Address on Row_Command event.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

It doesn't matter you use a domain name or ip adress, it always open the same page.
But if you want to open an website with the ip address displayed on the address bar you must open the link with ip address.
For example, both of these links below open the same page and you can spit out the differences by looking at the address bar.
 
Open these links in new tab, and you will understand by your self.
link with ip address[^]
link with domain[^]
  Permalink  
v2
Comments
manjujasmine at 25-Mar-13 2:53am
   
U r rt
can u send the code of link with ip address because I want to check it with my site in local.
Plz help me
Shanu2rick at 26-Mar-13 2:16am
   
well, you can't.
in order to implement this you should have your static ip address of your own.

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

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 105
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 25 Mar 2013
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