| | |
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 |
"crystal .net .net2005 30minutes 2005 2008 access account arithmetic array basic binary bing button buttons center check code component connectionstring crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dissertationthesis dropdownlist excel fade file-dialog folder ftp generatetags hardcopy image images input insert intel internet login math mobile monitor ms navigate net networking objects opacity output passingparameters peertopeervideostreaming picturebox picturebox1 port problem problemwithinstallation project reports" savedialog searchvb.net select serial shutdown soap string survey tcp temperature text textbox timer toolbox trim update updown user usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf






