| | |
Passing unicode query string to popup window using window.open method
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jul 2008
Posts: 22
Reputation:
Solved Threads: 0
Hi,
I am trying to pass query string from one page to popup window as follow:
The popup window comes up very well only if the text I typed is in english. otherwise the popup window comes up empty and the string I see in the "view source" option (in IE) is "%ufffd%%ufffd...."
I will need to query some unicode characters.
Any idea?
Thanks.
I am trying to pass query string from one page to popup window as follow:
VB.NET Syntax (Toggle Plain Text)
Dim popupScript As String = "window.open('cFinder.aspx?cName=" & c_TextBox.Text & "','', 'width=420,height=200,menubar=no,scrollbars=yes');" If (Not Page.ClientScript.IsStartupScriptRegistered("popup")) Then Page.ClientScript.RegisterStartupScript(Me.GetType(), "popup", popupScript, True) End If
The popup window comes up very well only if the text I typed is in english. otherwise the popup window comes up empty and the string I see in the "view source" option (in IE) is "%ufffd%%ufffd...."
I will need to query some unicode characters.
Any idea?
Thanks.
•
•
Join Date: Jul 2008
Posts: 22
Reputation:
Solved Threads: 0
For those who needs the same solution:
I found a VB function that "convert" 'response.redirect' to popup window...
And in the btnSubmit sub:
Of course, you'll have to translate the session item on NextPage.aspx if you need to make a query.
Enjoy...
I found a VB function that "convert" 'response.redirect' to popup window...
VB.NET Syntax (Toggle Plain Text)
Public Sub Redirect(ByVal url As String, ByVal target As String, ByVal windowFeatures As String) Dim context As HttpContext = HttpContext.Current If ([String].IsNullOrEmpty(target) OrElse target.Equals("_self", StringComparison.OrdinalIgnoreCase)) AndAlso [String].IsNullOrEmpty(windowFeatures) Then context.Response.Redirect(url) Else Dim page As Page = DirectCast(context.Handler, Page) If page Is Nothing Then Throw New InvalidOperationException("Cannot redirect to new window outside Page context.") End If url = page.ResolveClientUrl(url) Dim script As String If Not [String].IsNullOrEmpty(windowFeatures) Then script = "window.open(""{0}"", ""{1}"", ""{2}"");" Else script = "window.open(""{0}"", ""{1}"");" End If script = [String].Format(script, url, target, windowFeatures) ScriptManager.RegisterStartupScript(page, GetType(Page), "Redirect", script, True) End If End Sub
And in the btnSubmit sub:
VB.NET Syntax (Toggle Plain Text)
Session.Item("ObjToRedirect") = TextBox1.Text Redirect("NextPage.aspx", "_blank", "width=200,height=200,menubar=no,scrollbars=yes")
Of course, you'll have to translate the session item on NextPage.aspx if you need to make a query.
Enjoy...
![]() |
Similar Threads
- Having problem in the choice in using Query String OR session/cookies (VB.NET)
- getElementsByName() generates undefined ouput value in a textbox (JavaScript / DHTML / AJAX)
- Mail form Subject Help (JavaScript / DHTML / AJAX)
- how to open popup window by clicking hyperlink in gridview and to pass query string (ASP.NET)
- "Popup" in the same window! (Site Layout and Usability)
- encrypt and decrypt query string (VB.NET)
- Dynamic query string (Search Engine Optimization)
Other Threads in the VB.NET Forum
- Previous Thread: ListView Small Probs
- Next Thread: loginid and password form
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 2005 2008 access account application arithmetic array arrays basic bing button buttons c# center check checkbox code combobox component convert crystalreport data database datagrid datagridview date dissertation dissertations dropdownlist excel fade file-dialog ftp generatetags google gridview hardcopy images inline input insert intel internet listview mobile monitor ms net networking objects output passingparameters peertopeervideostreaming picturebox picturebox1 port print printing problem problemwithinstallation project remove save searchbox searchvb.net select serial server shutdown soap sorting survey table tcp temperature text textbox timer toolbox trim update updown user validation vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf






