Solved

Use Javascript to create resizable window

Posted on 2014-03-20
2
263 Views
Last Modified: 2014-03-21
How can I make this code open a resizable window?
    Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        Try
            If e.Row.RowType = DataControlRowType.DataRow Then


                Dim lnk As LinkButton = DirectCast(e.Row.FindControl("lnk_productid"), LinkButton)

                Dim url As String = SuppliedFileChangeURL & "?SuppliedFileID=" + lnk.Text

                'lnk.Attributes.Add("onClick", (Convert.ToString("JavaScript: window.open('") & url) + "','','_blank','width=5000,height=200,left=350,top=400,resizable=yes')")
                lnk.Attributes.Add("onClick", (Convert.ToString("JavaScript: window.open('") & url) + "','','_blank','width=5000,height=200,left=350,top=400,resizable=1')")
            End If
        Catch generatedExceptionName As Exception
        End Try
    End Sub

Open in new window

0
Comment
Question by:AlHal2
2 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 250 total points
ID: 39944547
Not knowing .Net much, what is with the convert to string?
If it is in quotes it should already BE a string.
Also there is no need for the javascript:
Lastly you have too many quotes

I would imagine

lnk.Attributes.Add("onClick","window.open('" & url &"','_blank','width=5000,height=200,left=350,top=400,resizable')") 

Open in new window

0
 

Author Closing Comment

by:AlHal2
ID: 39945027
thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question