Solved

Use Javascript to create resizable window

Posted on 2014-03-20
2
262 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 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