vb.net popup window - asp.net

i have an aspx page which has a button on it. When i click on the button, a popup should open up and the page should automatically redirect to next page. So Page1 has button1. When button1 is clicked popup1 is opened and page1 behind goes to page2. how do i do that?

OK if you want to display a popup and not a message box, you could use something like:
function ShowAndMove()
{
window.open('popup.htm');
form.submit();
}

If you are looking for a popup in a browser, you want to use Javascript.
button1.onclick() = window.location="page2.html"; window.alert("Press OK to continue to Page 2.");
Use window.alert if you just want a plain dialogue box.

Related

How to hide the .aspx page when jquery popup box is opened?

I have an Navigation link, when user click the link, popup dialogue box is opened,at the same time i want to hide the aspx page. It means user unable to perform any operation until user click the close button in dialogue box.
You need the modal dialog.
$(".selector").dialog({
modal: true
});

backward to previous page

in my project I have two pages, page1 and page2. In page1 I have few dropdown controls to filter the records from the db. And in the grid view I have the button as "View details". When I click the "view details button, the page has to redirect to page2 and complete details of that record will be viewed.
Now what I need is I have back button in page2. when I click that button, the page has to go back to page1 and page should display like how I left it, should not load as fresh page....
Since beginner to asp.net I couldn't find the solution for this issue.
Please provide with some example....
Very thanks in advance...
Try this in you viewdetails button click event:
Server.Transfer("Page2.aspx")
And similarly in your page2 back button click event
Server.Transfer("Page1.aspx")
The Server.Transfer method also has a second parameter—"preserveForm". If you set this to True, using a statement such as Server.Transfer("Page2.aspx", True), the existing query string and any form variables will still be available to the page you are transferring to.
A simple solution would be to keep any such filters that you have set in session.
This allows you to keep the filters active even when the user navigates away from the page.
You can have a button the Page1 to clear the filters.
Page1 Load:
if(!String.IsNullOrEmpty(Session["Filter1"]))
{
dropDownList1.Text = Session["Filter1"];
}
Page1 dropDownList1_SelectedIndexChanged
Session["Filter1"] = dropDownList1.Text;

Button clicks are ignored based on URL

I've one strange issue.I have one asp.net button on webpage integrate with masterpage.when I call the page using the url something like that http://www.mywebsite.com from address bar and click on button nothing is happened,it stays on same url. means it ignore the button click event.
Now if I call the page using url http://www.mywebsite.com/default.aspx and click on button then it capture the button click even and execute the code inside that button click
how can I solve this issue ?

asp.net form postback or not depending on button clicked

I need an idea for a situation like this:
There is this aspx form which contains some buttons like "save", "import", and print;
on the last one clicked a window should appear providing the user with a print-friendly version. what i need is the form not to cause postback and reload in this case, while normally postback-ing when the other buttons are clicked.
Or use hyperlink with target="_blank" to open up the document in a new window.
If you like to use the button, you have to use the window.open syntax to open a new page: http://www.javascript-coder.com/window-popup/javascript-window-open.phtml
HTH.

determining that a Postback opens a new page

I have a page (page1) with a LinkButton that, when clicked, will take the browser to a new page (page2).
When I click the LinkButton page1 posts back and hits the Init and Load event handlers for page1, and then moves on to page2.
How can I tell in the page1 postback that I am about to be taken to a new page, as opposed to clicking a Button that causes the page posts back but does not navigate away?
You can also add OnClick events to your code behind for each button, and in the case of the one that is to postback to another page, do a Response.Redirect. The limitation of that however is that if you need form data on "page2", you will lose posted form data on a Response.Redirect.
It appears that you're not using the OnCLick event of the LinkButton, If you use the event, perform the action of the click there, not on the Page Load event?

Resources