Web Forms :: OnClick, Add Ddl Selection To Url And Open New Window?
Mar 6, 2010
I am trying to open a new window on a button click event. I have seen several similar threads on this topic, but none worked for what I am trying to do.What I am trying to do...
- select an item from a dropdownlist
- click a button
- on the button click, open a new window (preferably 500 x 600) and go to a url based upon the selected ddl item
What is actually happening...
- a new tab is opening
Here is the .aspx
When the user selects an item in the dropdownlist and then presses the button, a new window opens and goes to a url based upon the selecteditem in the dropdown list. For example, if the user selects "10" from the ddl, then pressing the button should open a new window and go to ~/NewPage.aspx?id=ref#10
Here is the .aspx.cs
Note: You may notice that I repeat the same code in the ddl selectedindexchanged event and the button click event. This is because only placing it in the button click event required two clicks (the first only sets the attribute). I couldn't figure out any other way to do it. If you know a better way, feel free to suggest one and I will mark it as an answer if it works. But, my real concern is the question about opening a new window.
I am trying to integrate classic asp pages with the new .net pages. my asp.net site uses a master page, so I want to pop up the old pages in their own window, how can i do that from the menu selection?
i have an aspx page in which a link in the grid view opens a popup page . the data in the grid view would be dynamic and i need to send the id of the row of grid while calling the child window. i get the id using sender.id, but how would i send this using window .open()?
I have a login page that is loaded in popup window (colorbox) and after user logs in it should be closed and parent window should be loaded with new page.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Do While reader.Read() If Trim(reader("ZAP").ToString()) = Trim(textBoxZap.Text) Then Session("A") = "1" Response.Redirect("~/default.aspx") Else lblErr.Text = "incorect" End If Loop
So once the buton is clicked and user name and password is corect popup window should be closed and user redirected to default aspx.
I am trying to open a popup window from main window using window.open() method. How to get back the value from the called popup window to the calling window in vb.net, basically i need to get back the value and populate in the text box available in the main window.
I have an asp.net page that contains an Iframe embedded with some data and a ImageButton. On ImageButton click event (server side) I have Response.Redirct:
This always open the results.aspx in iframe. I want that results.aspx should always open in the parent window. I tried the following till now but none worked:
How do I pass a window name to window.open(url, windowname) programmatically? I am using a user control inside aspx forms. I want the windowname to be different, so from each link a separate window opens.
I have an asp:hyperlink in a .ascx form. The code looks like this:
<asp:hyperlink runat="server" id="xx", navigateurl="is set programmatically" onclick="javascrip:return popup(this, 'my window'; " text="xxx"/> 'my window' needs to be a variable.
I have an aspx page which contains a user control(a gridview). When I click on a link button in the gridview, I will open a popup window(An aspx page) successfully. When I click on save button in the popup, I am saving the details and refreshing the parent page successfully. I have a button in popup window. My requirement is:
When I click on the button inside popup window1, I would like to open another popup(aspx)(Say popup window2) in a new window without closing popup window1. When I save some changes in popup window2 and click on save button in popup window2, I need to close it and refresh popup window1.
and I want when I click on linkbutton it doesn't open new window...
here when I click on linkbutton it doesn't open new window it is correct but when I click on imagebutton and it opens new window and back to page and click on linkbutton it open linkbutton in new window...
I want when I click on link button it doesn't open new window any way...
we are running a click-to-call service, my idea is basically like this: website have a link on their page, when the link is clicked, a web page(say it is popup.aspx) hosted on our server is popup, user can input their phone number, and click "call me" button to let the website call him. In the button click event, I want to get Request.UrlReferrer, then query the db to get website's phone. But in IE, Request.UrlReferrer is null(firefox is ok, not test chrome yet),my question is how to get opening window' url in IE? we put popup.aspx on our server because
our client website is not force to use asp.net. we have the control what we put on the popup window, and can modify the page just from our side, if we put the pop window on our partner's side, if we have 100 partner, and we change the page's design, we will notify everyone of them to change this, change that. we can implement a statics system to know how popup a day, which site is most popular,etc
In VB.net .... I have GridView from which i select list of rows using check box and upon clicking the button i need to display those selected rows in a gridView of another page. and that page is a popup window?
I have a pop up window which contains a listbox. The items on the listbox should be filtered when it is opened based on the other parameters on the parent page. I am using session to pass the values from a page to another.
I'm using the following span to open a page in a new window. What is INCREDIBLY odd is that it is exactly the same code from three different pages, but the first refuses to open in a new window. The only difference is that the first example resides within an Ajax Accordian Panel so I suspect that it might be an Ajax related issue.
Is it possible to Open a new browser tab/window using c#. I have query string info I don't want to put in a hidden field due to it showing on the client side. I do save the data in ViewState and encrypt the viewstate; however, I don't know how to access that information on client side.
I can access the viewstate data fine on Server Side but I need to open the new browser window on server side in order to access the ViewState. I may be wrong. Is there a trick to this?
I did find a way; however, on any other click after the initial click everything goes to a new window: