Solved

Use Javascript to create resizable window

Posted on 2014-03-20
2
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

734 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