Solved

Use Javascript to create resizable window

Posted on 2014-03-20
2
258 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
Comment Utility
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
Comment Utility
thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now