Showing posts with label browser. Show all posts
Showing posts with label browser. Show all posts

Saturday, March 31, 2012

Set a hyperlink to open in window.

how do you set a hyperlink to open the link in a new window/browser, so I dont lose my current place in the site.

you have to do this with client code

<a href="http://links.10026.com/?link=blah" TARGET="_new"...>

the "_new" is a name you assign to a window. Use that with more then one call and they will reuse the window.

You can't specify the window (new or otherwise) with a Response.Redirect() or any other server call, sorry...


If you need to do this in the code behind and not in the HTML you can use this syntax:

Me.ClientScript.RegisterClientScriptBlock(Me.GetType,"open","<script language=javascript>window.open('http://www.yourpage.aspx');</script>")


Simply the below code

<a href="http://links.10026.com/?link=WebForm1.aspx" target="_blank">Open new window</a>

HC


As everybody as already said

<a href="http://links.10026.com/?link=URL" target="_blank>Clicking on this opens a new window</a>

however if you are using hyperlink button in asp.net then

<asp:HyperLinkid="value"Runat="Server"
ImageUrl="url"
NavigateUrl="url"
Target="_blank|_self|_top|_parent|framename"
Text="string"
property="value"
Style="CSS style settings..."
/>

you can choose target=_blank as described.

Hope that helps and good luck

set browser window size

I am trying to display my form in a fixed browser window so the user cannot change it's size, cannot minimize/maximize the window. The aspx form is for user input, and I want each user to see the same thing. (it's an internal form and everyone has the same browser). Where do I make these changes, or what code do I need? I figured it would be in the properties menu for the form, but the page margins do not make the changes I need. Any ideas on what to do?

Thanks.You can set thewindow properties from the client (i.e. note, no "runat" attribute in the script tag), only after the first page is loaded:

<SCRIPT for="window" event="onload">
window.dialogHeight = 100;
window.dialogLeft = 100;
window.dialogTop = 100;
window.dialogWidth = 100;
</SCRIPT>

Set browser in PrinPreview state on page load

Hi, Can i set the clients browser programmatically to PrintPreview state (File->Print Preview) when the client clicks the button print?

I don't want to use Crystal nor Report Viewer for some reasons

regards

Thanks in advance! More Power!

Hi,

As far as I know, it's impossible because you have to manipulate IE from client. If so, that means you have access to control windows process, then that's very dangerous. What's more, in fact, there are little APIs for us to control IE's function, especially such thing.

HTH


Hey Dfox,

Unfortunately asp.net works server side, so you can't change client side behaviour.

Keep up the good programming!

Monday, March 26, 2012

set div width to remaining width of the browser

using float: left and float: right to build a two column page
layout.
<div style="float:left">column 1</div>
<div style="float:right">column 2</div>
then I set the width of the first column to a fixed size:
<div style="float:left; width:10em;>column 1</div>
how can I set the width of the 2nd column, the float:right div, to
fill the remaining space of its container?
I know I can use percentages, but I want the left column to always be
the same fixed length.
Is this a case where <table> is the obvious solution?
thanks,
-SteveDo you need this?
<div style="float:left; width: 10em; border: solid 1px red">
ZZZZZ
</div>
<div style="margin-left: 10em; border: solid 1px green">
www
<div>

> using float: left and float: right to build a two column page
> layout.
> <div style="float:left">column 1</div>
> <div style="float:right">column 2</div>
> then I set the width of the first column to a fixed size: <div
> style="float:left; width:10em;>column 1</div>
> how can I set the width of the 2nd column, the float:right div, to
> fill the remaining space of its container?
> I know I can use percentages, but I want the left column to always be
> the same fixed length.
> Is this a case where <table> is the obvious solution?
> thanks,
> -Steve
>
On Jun 15, 2:00 pm, Yuriy Solodkyy <y.dot.solod...@.gmail.com> wrote:
> Do you need this?
> <div style="float:left; width: 10em; border: solid 1px red">
> ZZZZZ
> </div>
> <div style="margin-left: 10em; border: solid 1px green">
> www
> <div>
>
thank you. I just read of the margin technique in a very good book I
have:
http://www.amazon.com/CSS-Anthology...81932373&sr=8-1
a lot of CSS positioning seems to be a hack. esp if you dont want to
use javascript out of concern of complicating things even further.
I assume CSS does not allow one div to reference another for is
position and size? That would seem to be ideal for page layouts.
( where the height of div a is always the height of div b, div c
always has the same absolute X position of div d, ... )
thanks,
-Steve

set div width to remaining width of the browser

using float: left and float: right to build a two column page
layout.
<div style="float:left">column 1</div>
<div style="float:right">column 2</div>

then I set the width of the first column to a fixed size:
<div style="float:left; width:10em;>column 1</div>

how can I set the width of the 2nd column, the float:right div, to
fill the remaining space of its container?

I know I can use percentages, but I want the left column to always be
the same fixed length.

Is this a case where <tableis the obvious solution?

thanks,

-SteveDo you need this?

<div style="float:left; width: 10em; border: solid 1px red">
ZZZZZ
</div>
<div style="margin-left: 10em; border: solid 1px green">
www
<div>

Quote:

Originally Posted by

using float: left and float: right to build a two column page
layout.
<div style="float:left">column 1</div>
<div style="float:right">column 2</div>
then I set the width of the first column to a fixed size: <div
style="float:left; width:10em;>column 1</div>
>
how can I set the width of the 2nd column, the float:right div, to
fill the remaining space of its container?
>
I know I can use percentages, but I want the left column to always be
the same fixed length.
>
Is this a case where <tableis the obvious solution?
>
thanks,
>
-Steve
>


On Jun 15, 2:00 pm, Yuriy Solodkyy <y.dot.solod...@.gmail.comwrote:

Quote:

Originally Posted by

Do you need this?
>
<div style="float:left; width: 10em; border: solid 1px red">
ZZZZZ
</div>
<div style="margin-left: 10em; border: solid 1px green">
www
<div>
>


thank you. I just read of the margin technique in a very good book I
have:
http://www.amazon.com/CSS-Anthology...81932373&sr=8-1
a lot of CSS positioning seems to be a hack. esp if you dont want to
use javascript out of concern of complicating things even further.

I assume CSS does not allow one div to reference another for is
position and size? That would seem to be ideal for page layouts.
( where the height of div a is always the height of div b, div c
always has the same absolute X position of div d, ... )

thanks,

-Steve

Thursday, March 22, 2012

set masterpage for browser in web.config (.net2.0)

Hi,
it is possible to set the browser dependent masterpage in the web.config,
and how?
in the page attributes it is an easy way, but in the web.config?
In the page-tag it would look like this:
<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" ie:MasterPageFile="~/MasterPage_IE.master"
mozilla:MasterPageFile="~/MasterPage_Firefox.master" %>
Thanks a lot,
Alex<configuration>
<system.Web>
<pages master="default.master" />
</system.Web>
</configuration>
Ashok
"Alexander Widera"
<awid@.hrz.tu-chemnitz.de-novaliddomainpleasedeletethispart.de> wrote in
message news:OZ4GZEBBGHA.3536@.TK2MSFTNGP11.phx.gbl...
> Hi,
> it is possible to set the browser dependent masterpage in the web.config,
> and how?
> in the page attributes it is an easy way, but in the web.config?
> In the page-tag it would look like this:
> <%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
> Inherits="_Default" ie:MasterPageFile="~/MasterPage_IE.master"
> mozilla:MasterPageFile="~/MasterPage_Firefox.master" %>
>
> Thanks a lot,
> Alex
>
>
this is for the "default" browser...
but how to set special masterpages for different browsers (in the
web.config)?
In the page tag it looks like that (see below)... but in the web.config
...
i dont now how...
<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" ie:MasterPageFile="~/MasterPage_IE.master"
mozilla:MasterPageFile="~/MasterPage_Firefox.master" %>
alex
"Showjumper" <dfgkjhdf> schrieb im Newsbeitrag
news:e3aiMiBBGHA.4092@.TK2MSFTNGP09.phx.gbl...
> <configuration>
> <system.Web>
> <pages master="default.master" />
> </system.Web>
> </configuration>
> Ashok
> "Alexander Widera"
> <awid@.hrz.tu-chemnitz.de-novaliddomainpleasedeletethispart.de> wrote in
> message news:OZ4GZEBBGHA.3536@.TK2MSFTNGP11.phx.gbl...
web.config,
CodeFile="Default.aspx.cs"
>
>
hasn't anybody a solution?
"Alexander Widera"
<awid@.hrz.tu-chemnitz.de-novaliddomainpleasedeletethispart.de> schrieb im
Newsbeitrag news:%23dQzXgHBGHA.2708@.TK2MSFTNGP12.phx.gbl...
> this is for the "default" browser...
> but how to set special masterpages for different browsers (in the
> web.config)?
> In the page tag it looks like that (see below)... but in the web.config
> ...
> i dont now how...
> <%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
> Inherits="_Default" ie:MasterPageFile="~/MasterPage_IE.master"
> mozilla:MasterPageFile="~/MasterPage_Firefox.master" %>
> alex
>
>
> "Showjumper" <dfgkjhdf> schrieb im Newsbeitrag
> news:e3aiMiBBGHA.4092@.TK2MSFTNGP09.phx.gbl...
> web.config,
> CodeFile="Default.aspx.cs"
>
>

Tuesday, March 13, 2012

Set pages encoding in code

A user can set the encoding his browser uses (In IE: View > Encoding).
I will show the page in the language the user selected (English or Japanes).
I do not want to create a seperate page for each language.
On the forms is some UserControls, with say menu's which i build in C# code, and I set the text of menu items according to the selected language.
The body of the page will be text extracted from the database in either English or Japanese.
Can one (should one?) set the page encoding in your code? I've seen that on the older asp pages, the developer set it to one value (en-jpn or sth like that...don't have access to the code as i'm typing), even though the page can be displayed in different languages, what l but sometimes a user have to go and manually set the encoding in his browser for the text to display correctly. (note : *Sometimes*)
Any suggestions what course to follow here?
It seems that with Chinese characters, on don't have problems, but Japanese is a bummer on it's ownGoogle for ResponseEncoding in ASP.NET.

BUT, I don't think that's the way it was meant to be/work. Shouldn't you be checking the language settings of the browser instead? (Tools > Options > languages)