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_Cli ck(object sender, System.EventArg s e)
{
string script = "<script language=\"java script\">";
script += "var target = '_blank';";
script += "window.open('A ctiveVendors.as px', 'target',
'fullscreen=no, channelmode=no,
toolbar=no,menu bar=no,location =no,directories =no,height=400, width=350,resiz able=no,scrollb ars=yes')";
script += "window.open('w ebsite', 'target', 'fullscreen=no, channelmode=no,
toolbar=no,menu bar=no,location =no,directories =no,height=800, width=800,resiz able=yes,scroll bars=yes')";
script += "</script>";
Page.RegisterSt artupScript("wi nOpen", script);
}
where website = "http://www.marconi.com " 3 2334
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****@discuss ions.microsoft. com> wrote in message
news:A9******** *************** ***********@mic rosoft.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_Cli ck(object sender, System.EventArg s e) { string script = "<script language=\"java script\">"; script += "var target = '_blank';"; script += "window.open('A ctiveVendors.as px', 'target', 'fullscreen=no, channelmode=no, toolbar=no,menu bar=no,location =no,directories =no,height=400, width=350,resiz able=no,scrollb ars=yes')"; script += "window.open('w ebsite', 'target', 'fullscreen=no, channelmode=no, toolbar=no,menu bar=no,location =no,directories =no,height=800, width=800,resiz able=yes,scroll bars=yes')"; script += "</script>"; Page.RegisterSt artupScript("wi nOpen", script); }
where website = "http://www.marconi.com "
I'm sorry but I posted the wrong code. This is the actual code:
private void lbtnWebsite_Cli ck(object sender, System.EventArg s e)
{ string website = Session["website"].ToString();
string script = "<script language=\"java script\">";
script += "var target = '_blank';";
script += "window.open('w ebsite', 'target',
'fullscreen=no, channelmode=no,
toolbar=no,menu bar=no,location =no,directories =no,height=800, width=800,resiz able=yes,scroll bars=yes')";
script += "</script>";
Page.RegisterSt artupScript("wi nOpen", 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_Cli ck(object sender, System.EventArg s e) { string script = "<script language=\"java script\">"; script += "var target = '_blank';"; script += "window.open('A ctiveVendors.as px', 'target', 'fullscreen=no, channelmode=no, toolbar=no,menu bar=no,location =no,directories =no,height=400, width=350,resiz able=no,scrollb ars=yes')"; script += "window.open('w ebsite', 'target', 'fullscreen=no, channelmode=no, toolbar=no,menu bar=no,location =no,directories =no,height=800, width=800,resiz able=yes,scroll bars=yes')"; script += "</script>"; Page.RegisterSt artupScript("wi nOpen", script); }
where website = "http://www.marconi.com "
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****@discuss ions.microsoft. com> wrote in message news:A9******** *************** ***********@mic rosoft.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_Cli ck(object sender, System.EventArg s e) { string script = "<script language=\"java script\">"; script += "var target = '_blank';"; script += "window.open('A ctiveVendors.as px', 'target', 'fullscreen=no, channelmode=no, toolbar=no,menu bar=no,location =no,directories =no,height=400, width=350,resiz able=no,scrollb ars=yes')"; script += "window.open('w ebsite', 'target', 'fullscreen=no, channelmode=no, toolbar=no,menu bar=no,location =no,directories =no,height=800, width=800,resiz able=yes,scroll bars=yes')"; script += "</script>"; Page.RegisterSt artupScript("wi nOpen", script); }
where website = "http://www.marconi.com "
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: ASP Spam Fighter |
last post by:
Curt_C Wrote:
> open the request in a new window
That would work fine for me, but I'm writing this script for people
who believe that we must assume total and utter user stupidity. Since
this trick only seems to work manually using a right click->open in
new window and never automatically (using a target attribute or a
javascript event), this may be too much of a mind stretch for this
priviledged class of users.
|
by: alan_coffman2004 |
last post by:
Opening an ASP.NET VS2002 project in VS2003, am getting this error:
"Unable to open Web project 'MyProject'. The file
path 'c:\inetpub\wwwroot\MyProject' does not correspond to
the URL 'http://Localhost:/MyProject'. The two need to map
to the same server location. HTTP Error 404: Not Found."
I have tried fixing this using both of these KB articles and usenet
advises, still problem not solved:
|
by: Rob Meade |
last post by:
Hi all,
I have installed VS2005 in an attempt to start writing some nice new .net
2.0 pages....alas...
Running on a laptop - XP Pro - I have Frontpage Server Extensions Installed,
O/S is all patched up to the hilt etc..
When I try to either create or open a website on the local host I get an
error telling me how Visual Web Developer cannot create/open a website on a
|
by: Brad |
last post by:
I have a win2003 server workstation with multiple webs, each web has it's
own ip address. In VS2005, if I select to open an existing web site, select
Local IIS, the dialog correctly displays a list of all of my webs, however
if I attempt to open a site under and web other than localhost I receive the
message:
"Unable to open the Web 'http://localhost/anywebappname'. The Web
'http://localhost/anywebappname' does not exist"
Obviously...
|
by: bazzer |
last post by:
hey,
im trying to access a microsoft access database from an ASP.NET web
application in visual basic 2003.NET. i get the following error when i
try running it:
Server Error in '/CinemaBookingSystem' Application.
--------------------------------------------------------------------------------
ERROR General error
Unable to open registry key 'Temporary (volatile) Jet DSN for process
| |
by: anToNIcHeN |
last post by:
Hi All,
I am getting this frustating error message when i try to open my
project using VS.NET 2003.
OS: Windows 2003 Standard Edition with SP2
S.W Installed : VS.NET 2003, VS.NET 2005, Sharepoint Portal Server
2003.
In my IIS, I have created a website under port 111. And i have created
a virtual site under the website and correctly pointed out the path to
|
by: ssg31415926 |
last post by:
I'm getting the error: "Unable to open the Web 'http://blah/blahblah'.
You are not authorized to perform the current operation". I have
changed a few things recently but I can't change them back as I need
them. I can't find anything about it using searches.
Yesterday, I removed the "Enable anonymous access" option from my web
(within the Default Web Site). The web has Integrated Windows
authentication checked. The site must check AD...
|
by: Cintury |
last post by:
Hi all,
I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql server mobile ce database. Until recently I was synching everything thru a com port serial cable. The devices would connect to the computer thru activesync and are able to acquire an internet connection. The sync for the program occurs thru a website...
|
by: benoitc |
last post by:
I've been having a problem debugging an ASP.NET 1.1 application on an
existing Windows XP/Visual Studio 2003 workstation that I've inherited
from somebody else. The application builds fine, but when I try to
debug, it gives me the message: Error When Trying to Run Project:
Unable to Start Debugging on the Web Server. Debugging failed because
integrated Windows authentication is not enabled.
Now, the obvious solution for this of course...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |