By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,276 Members | 1,951 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,276 IT Pros & Developers. It's quick & easy.

unable to open website

P: n/a
I have a C# asp.net webform with a Link Button to a website but it's not
opening the website correctly. It's saying "The page cannot be found". But
the website is loading when I use IE. Below is the code and thanks in advance.

private void lbtnWebsite_Click(object sender, System.EventArgs e)
{
string script = "<script language=\"javascript\">";
script += "var target = '_blank';";
script += "window.open('ActiveVendors.aspx', 'target',
'fullscreen=no,channelmode=no,
toolbar=no,menubar=no,location=no,directories=no,h eight=400,width=350,resizable=no,scrollbars=yes')" ;
script += "window.open('website', 'target', 'fullscreen=no,channelmode=no,
toolbar=no,menubar=no,location=no,directories=no,h eight=800,width=800,resizable=yes,scrollbars=yes') ";
script += "</script>";
Page.RegisterStartupScript("winOpen", script);
}

where website = "http://www.marconi.com"
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
hi,

I have no idea why you use this code, would't it be easier if you just use
a regular link in the client?
What is the point in doing a postback in this case?

in case you have to hide/show the button you can solve this in several ways,
either using CSS or just including the A tag inside a grouping web control
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Newbie" <Ne****@discussions.microsoft.com> wrote in message
news:A9**********************************@microsof t.com...
I have a C# asp.net webform with a Link Button to a website but it's not
opening the website correctly. It's saying "The page cannot be found". But
the website is loading when I use IE. Below is the code and thanks in
advance.

private void lbtnWebsite_Click(object sender, System.EventArgs e)
{
string script = "<script language=\"javascript\">";
script += "var target = '_blank';";
script += "window.open('ActiveVendors.aspx', 'target',
'fullscreen=no,channelmode=no,
toolbar=no,menubar=no,location=no,directories=no,h eight=400,width=350,resizable=no,scrollbars=yes')" ;
script += "window.open('website', 'target', 'fullscreen=no,channelmode=no,
toolbar=no,menubar=no,location=no,directories=no,h eight=800,width=800,resizable=yes,scrollbars=yes') ";
script += "</script>";
Page.RegisterStartupScript("winOpen", script);
}

where website = "http://www.marconi.com"

Nov 17 '05 #2

P: n/a
I'm sorry but I posted the wrong code. This is the actual code:

private void lbtnWebsite_Click(object sender, System.EventArgs e)
{ string website = Session["website"].ToString();
string script = "<script language=\"javascript\">";
script += "var target = '_blank';";
script += "window.open('website', 'target',
'fullscreen=no,channelmode=no,
toolbar=no,menubar=no,location=no,directories=no,h eight=800,width=800,resizable=yes,scrollbars=yes') ";
script += "</script>";
Page.RegisterStartupScript("winOpen", script);
}

where Session["website"] is assigned somewhere else.

"Newbie" wrote:
I have a C# asp.net webform with a Link Button to a website but it's not
opening the website correctly. It's saying "The page cannot be found". But
the website is loading when I use IE. Below is the code and thanks in advance.

private void lbtnWebsite_Click(object sender, System.EventArgs e)
{
string script = "<script language=\"javascript\">";
script += "var target = '_blank';";
script += "window.open('ActiveVendors.aspx', 'target',
'fullscreen=no,channelmode=no,
toolbar=no,menubar=no,location=no,directories=no,h eight=400,width=350,resizable=no,scrollbars=yes')" ;
script += "window.open('website', 'target', 'fullscreen=no,channelmode=no,
toolbar=no,menubar=no,location=no,directories=no,h eight=800,width=800,resizable=yes,scrollbars=yes') ";
script += "</script>";
Page.RegisterStartupScript("winOpen", script);
}

where website = "http://www.marconi.com"

Nov 17 '05 #3

P: n/a
It's already working. Thanks.

"Ignacio Machin ( .NET/ C# MVP )" wrote:
hi,

I have no idea why you use this code, would't it be easier if you just use
a regular link in the client?
What is the point in doing a postback in this case?

in case you have to hide/show the button you can solve this in several ways,
either using CSS or just including the A tag inside a grouping web control
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Newbie" <Ne****@discussions.microsoft.com> wrote in message
news:A9**********************************@microsof t.com...
I have a C# asp.net webform with a Link Button to a website but it's not
opening the website correctly. It's saying "The page cannot be found". But
the website is loading when I use IE. Below is the code and thanks in
advance.

private void lbtnWebsite_Click(object sender, System.EventArgs e)
{
string script = "<script language=\"javascript\">";
script += "var target = '_blank';";
script += "window.open('ActiveVendors.aspx', 'target',
'fullscreen=no,channelmode=no,
toolbar=no,menubar=no,location=no,directories=no,h eight=400,width=350,resizable=no,scrollbars=yes')" ;
script += "window.open('website', 'target', 'fullscreen=no,channelmode=no,
toolbar=no,menubar=no,location=no,directories=no,h eight=800,width=800,resizable=yes,scrollbars=yes') ";
script += "</script>";
Page.RegisterStartupScript("winOpen", script);
}

where website = "http://www.marconi.com"


Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Browse more C# / C Sharp Questions on Bytes