Click here to Skip to main content
15,887,866 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Updated 24-Mar-13 20:39pm
v4
Comments
Shanu2rick 23-Mar-13 6:44am    
do you already have the ip address stored in your database?
manjujasmine 24-Mar-13 23:24pm    
Yes i have

Your e.CommandArgument property should return IP Address on Row_Command event.
 
Share this answer
 
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[^]
 
Share this answer
 
v2
Comments
manjujasmine 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 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)



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