Want to open a popup window from code behind

Hi,
I want to open a Popup window with code behind in ASPX page. So if you have ant codes and suggestion please do mail me.
I am online on yahoo messsanger in invisible mode and my yahoo chat is is 'naveen_uicsa'
Thanx
Naveen
-1
naveen_nayak
7/11/2005 5:19:26 AM
asp.net.web-forms 93655 articles. 3 followers. Follow

7 Replies
834 Views

Similar Articles

[PageSpeed] 43

Hello, 

use registerstartupscript function .

Dim mystr as new StringBuilder
with mystr
  .append("<script language='javascript'>")
  .append("window.open(theUrl, '', 'toolbar=0,width=350,height=250,left=40,top=50');")
  .append("</script>")
end with
registerStartupScript("PopupScript", mystr.ToString)


Hope this would help.

Regards,
Forza

Oracle, mySQL & ASP.net lover
-1
indoforza
7/11/2005 8:33:44 AM
Hi Naveen,
You can open popup window from client side code only. You can howewer generate this client code at server. I think this is what are you looking for.
Leon Langleyben

MCSD, ASP.NET MVP

Blog
-1
llangleyben
7/11/2005 8:41:06 AM
Hi Forza,

Thax for solution i'll try that. But please tell me can i pass full path for url or i can pas relative path.

Regards
Naveen
1
naveen_nayak
7/11/2005 10:06:30 AM

hi,
you can pass any valid url, including a full path on your site or any other site, and a relative path on your website.
Regards,
Ariya

1
ariya
7/11/2005 11:23:02 AM
Hi Forza,
When i am using StringBuiler then it is giving error StringBuilder not defined

Naveen
-1
naveen_nayak
7/12/2005 4:54:03 AM
Hi Naveen,
It is defined in System.Text namespace
Leon Langleyben

MCSD, ASP.NET MVP

Blog
1
llangleyben
7/12/2005 9:52:27 AM
Hello again naveen, 

Can you tell me what the error is? Have you put these code to the top of your code :

Option Strict off
Imports System
Imports System.Collections
Imports System.Text
Imports System.Data
Imports System.Data.OleDb
Imports System.Web.UI
Imports System.Web.UI.WebControls

If not, you should do that in order to function properly.

Hope this would help.

Regards,
Forza




Oracle, mySQL & ASP.net lover
-1
indoforza
7/13/2005 6:40:07 PM
Reply:

Similar Artilces:

open a popup window from.net code behind
Hi I am trying to open a new window from a button in my aspx side. This works, but I have to push the button 2 times before it open. Any idea? Public Shared Sub OpenPopUp(ByVal opener As System.Web.UI.WebControls.WebControl, ByVal PagePath As String) Dim clientScript As String 'Building the client script- window.open clientScript = "window.open('" & PagePath & "')" 'register the script to the clientside click event of the opener control opener.Attributes.Add("onClick", clientScript) End Sub Sub Button1_Click(sender As...

how to open popup window through javascript in code behind( popup window should be aligned center)
I want to use javascript in code behind to open popup window. I have Datalist inside which there is linkbutton. On click of linkbutton open popup window through javascript & that pop up window should be aligned centraly.Regards,Mahesh--------------------click "Mark as Answer" on the post that helps you. Friend, Try this sample . <html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server">    <title>Untitled Page</title>        <style>    .blue{ bac...

how to change these windows form code to web form code?
hi, i'm a beginner of c#,i want to know how to change these windows form code to web form code //////////// private void buttonSign_Click( object sender, System.EventArgs e) { //get original message as byte array byte[] messagebytes = Encoding.UTF8.GetBytes( textOriginalMessage.Text); //create digest of original message using SHA1 SHA1 sha1 = new SHA1CryptoServiceProvider(); byte[] hashbytes = sha1.ComputeHash(messagebytes); //display hash bytes in hex format StringBuilder sb = new StringBuilder(); for (...

Web Forms Designer error
Hi, The web forms designer keeps adding things in a generated InitializeComponent() method. I believe these things shouldn't be there because I've made a new webform with the same code that doesn't add the same stuff. Is there anyway I can see the Web Designer code? Thanks. Just expand out the hidden #region. It is labeled Web Form Designer CodeStarting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog...

open popup window from code behind
hi i am coding with vb , i need to open pop up window with out display any tool bars. and also need to pass a value to opening page which will need to get related data to display on pop up. need to cal java script inside a vb method   You can call this either via javascript or use Ajax Here is a good example http://www.codeproject.com/KB/custom-controls/asppopup.aspx  or the JavaScript version, which uses the the ScriptManager for the JavaScript: C#public static void OpenWindow(Page currentPage, String window, String htmlPage, Int32 width, Int32 height) { ...

How to open a popup window from C# code behind
Hi, When users click on submit button on my application, first it validates the data using requiredfieldvalidators, and then once all the data is perfect a popup window should open that tells them "please wait, processing request", the window stays as long as the parent unloads, I am able to do it by using Javascript and adding OnClick attribute to the button, but the problem is the popup opens everytime we click the button, even if it it fires the validators and not move to the next page, Can Anyone Help?? How about adding the popup code to the onsubmit event handler of the form tag inst...

How to open a popup window from C# code behind
Hi, When users click on submit button on my application, first it validates the data using requiredfieldvalidators, and then once all the data is perfect a popup window should open that tells them "please wait, processing request", the window stays as long as the parent unloads, I am able to do it by using Javascript and adding OnClick attribute to the button, but the problem is the popup opens everytime we click the button, even if it it fires the validators and not move to the next page, Can Anyone Help?? How about adding the popup code to the onsubmit event handler of the form tag inst...

opening multiple popup windows from code behind
HII am trying to open multiple pop up windows from code behind for the purpose of showing xls files but in only seems to work with one window. this is the code that I have so far. it works fine but when I'm trying to pop up more than one browser it only shows the first one.  file_array = dir.GetFiles("*.xls") For Each file In file_arrayClientScript.RegisterStartupScript (Me.GetType, "popup & file.Name &", "window.open('" & path & "','blank','menubar=no')", True) Next Can somebody help me in th...

Open popup window on click of button event from code behind side
 Hi friends I have one button called Preview which is placed in upadate panel. Now I want to open popup window on click of that button. I can call javascript onclientclick event but before open popup window i want to get some values from current window.I dont want to pass that value in query string. Here is my code <pre> ClientScript.RegisterStartupScript(this.GetType(), "JS", "javascript:window.open('PreviewPop.aspx?DesignID=" + txtImageHide.Value + "','MyTitle','height=250,width=505, top=100, left=100, scrollbars=yes, res...

windows forms in vb .net into web forms
we are creating a database driven website as part of our project. currently we have forms connecting to the database created in visual basic. these windows forms we need to convert into web forms which are asp .net compatible. can u give me an answer or show me a way. Hi, because of the difference in nature between web and win applications you'll need to reimplement at least the UI part. If you have a multitiered application in which the busines logic and data access are in different parts/assemblies you can reuse them. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Wor...

Javascript confirm message in c# code behind,by clicking ok popup window open
how can i set a confirm javascript message in c# code behind and by clicking ok i have to open a pop up .aspx page. Hello,     Add onclick attribute with javascript function containing window.open() within your c# code. btn.Attributes.Add("onclick", "javascript:window.open('YourPage.aspx')")  Thanks,santosh_maharajaPlease mark as answer if you got expected solution. http://plugins.jquery.com/project/confirm  Cool stuff // The action. $('span').mouseover(function() { $(this).html('Here is the offer'); });   $(&...

How to know in the code behind if the window has been open from another window
 HiI want to know in the code behind (server side) if the page has been open from another window. In the client side I can check, in a javascript function, if the window.opener is null or not, but how can I know this in the code behind. Is it possible?Thanks,Luis Miguel   I think your best bet might be to use a HiddenField, and populate that HiddenField with the javascript window.opener value. For example: <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html P...

how to open a web page in form of a popup web page
Hello, I have two web pages, let say. Page A : With a Button on it. PAge B: with some info. Now I need to: When I click on the Button of page A.Page B must open in a pop up window.  I can do this but problem is this when I clicked on the button for first time it does not show me any thing and when I clicked on the button for second time then It shows me Page B .My code is as follow:  1 protected void Page_Load(object sender, EventArgs e) 2 { 3 if (!this.Page.IsPostBack) 4 { 5 6 } 7 else 8...

How to send value form popup window to opener window ??
I have problem and I need everybody help me. I desgning a website using ASP.NET and VB.NET - I want, when user click button as show popup window with list user of system (from database) and click user of list, it's in textbox of opener window. Can you help me code it ??? Thanks a lot !!!  Không học không biết, học rồi sẽ biết  You have to access the window.opener.document object in JavaScript. This will give you access to the DOM. function getOpenerElem(Jb) { return window.opener.document.getElementById(Jb); }  I use this function to access the opening window...

Web resources about - Want to open a popup window from code behind - asp.net.web-forms


Window - Wikipedia, the free encyclopedia
This article is about the part of a building. For the Microsoft operating system, see Microsoft Windows . For other uses, see Window (disambiguation) ...

Microsoft Windows Information, Solutions, Tools - Windows IT Pro
Microsoft Windows information and solutions for IT pros. Topics include cloud computing, Windows Server, Exchange, Outlook, PowerShell, virtualization, ...

The Windows Blog
The Windows Blog is Microsoft's Official Blog for the Windows Operating System.

If you're fine with Microsoft's approach to privacy in Windows 10, you're out of touch
Yeah, I'm going to bang that drum again. We've talked endlessly about privacy and telemetry in Windows 10. Endlessly. It's brought up some interesting ...

Life hack: The scientifically proven way to defog your car windows faster
It's winter, which means that you're going to have to deal with foggy windows when you start up your car . While lots of people have their own ...

Mobile Alabama reopens marriage license window
... issuing marriage licenses altogether. Now they have resumed. ( Fox6News ) The Mobile County Probate Court will re-open marriage license windows ...

People are worried about how much information Windows 10 collects
There are growing concerns about how much information Windows 10 collects about users. Microsoft recently made statistics about the operating ...

LG’s New Signature Refrigerator Has a Viewing Window and Auto-Open Doors
... than ever, LG’s new signature fridge lets you take a peek inside the fridge without wasting energy. Just walk up and knock on the window panel ...

Samsung's home tech will eventually plug into Windows 10
Microsoft has revealed that it will join forces with Samsung to develop smart home "internet of things" (IoT) devices that work on Windows 10. ...

New Windows 10 stats show Microsoft is closely watching you — but is it an issue?
Windows 10 is collecting more information than some people may have realized, as is evidenced by the company's recent usage reports. Is this ...

Resources last updated: 1/9/2016 11:02:24 AM