Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
JavaScript to open new window and control window attribu
Message
General information
Forum:
ASP.NET
Category:
WebForms
Miscellaneous
Thread ID:
00992729
Message ID:
00993795
Views:
31
Here is how I ended up solving the problem:
Note there is an extra space between the opening < and % and closing % and >
NavigateURL=' <%# "javascript:window.open(\"CustomerContactHistory.aspx?CID=" + DataBinder.Eval(Container, "DataItem.CustomerID") + " \", \"\", \"status=0,toolbar=0,menubar=0,location=0,directories=0,scrollbars=1.resizable=1\"); javascript:void(0);"%> '
>Fred,
>Here is a good link for window.open:
>http://www.devguru.com/Technologies/ecmascript/quickref/win_open.html
>
>If you add the following code to a htm file and try to run it in a browser it will display a window without a toolbar:
>
><form>
><input type=button value="Open new window"
>onClick="myRef = window.open(''+self.location,'mywin','left=20,top=20,width=500,height=500,toolbar=0,resizable=0');">
></form>
>
>
>Maybe try to remove menubar=0 from your example.
>
>Einar
>
>>Here is the javascript that I am using to open and new window and control the attributes. The code works in several other areas but I cannot get it to work with NavigateURL. The correct page is displayed in a new window with the correct customer but the the toolbar and menubar are still visible.
>>
>>
>>NavigateUrl="javascript:window.open([Open Angle Bracket Percent Sign]# 'CustomerContactHistory.aspx?CID=' + DataBinder.Eval(Container, 'DataItem.CustomerID') ,'_new','toolbar=0,menubar=0')[Percent Sign Close Angle Bracket] "
>>
>>
>>I have tries to move the [Percent Sign Close Angle Bracket] around to different positions but it has not affect.
>>
>>Here is the entire line:
>>
>>
>><asp:HyperLink id=hlContact runat="server" NavigateUrl="javascript:window.open(([Open Angle Bracket Percent Sign]# 'CustomerContactHistory.aspx?CID=' + DataBinder.Eval(Container, 'DataItem.CustomerID') ,'_new','toolbar=0,menubar=0') [Percent Sign Close Angle Bracket] " CssClass="greentxt" Font-Underline="True">
>>
>>
>>Ideas???
>>
>>PS I really need to remmeber how to included the HTML codes like ([Open Angle Bracket Percent Sign]
Fred Lauckner

You know, it works on my computer. I don't know what your problem is.

.Net aint so bad.
Previous
Reply
Map
View

Click here to load this message in the networking platform