Navigate back in visual webgui - asp.net

I'm a newbie of ASP.NET world. I'm developing an app with asp.net and insiede of an aspx page i'm using a window form developed with visual webgui.
I've this problem: inside my form, i have a button wich has to rise an event equals to the page back button of the browser.
I tried to search informations about this, but i can't find anything unfortunately.
I think that i've to do something with the HttpContext. I tried with the Redirect function but my "previous page" is open always in a new browser window.
Can someone tell me a way on how to do this thing please?
Thank's
Marco
EDIT SOLVED
button.RegisterClientAction("history.go( -1 )", "");

Cant you do this:
Response.Redirect(Request.UrlReferrer.ToString());

Related

How do I Create an Entire Web Form along-with its respected Code-Behind(.cs) file in Asp.Net on click of a button?

I Want to create an entire Web-Form on click of a button along with its Code-behind(.cs) file . I can work fairly with Asp.Net but i love to explore new things.just a question that popped up in my mind while working on something new ! So please if anyone of the great minds out there can help please help me out. Thank You.
Instructions for Visual Studio 2013
Open your web solution
In Solution Explorer, right click the web project
Choose "Add Web Form"
Enter a name for the form
Click OK
See also this link
Just extend Web Form class, define properties and methods which will render and show your web form. Handle button click event, initiated web form. Finally display it.
If its normal form you can simply render it using jQuery/JavaScript.
Hope this helps you buddy. :)

ASP.net open new webform on click of button

I am using C# ASP.net, and relative new to it, and need to accomplish below.
In my VS2010 web application project I have default.aspx, form1.aspx with button1 and form2.aspx.
1-I want to set form1 as my home page (the first page that opens when I run app)
2-Want to open form2 when I click button on form1
Also, can you please suggest good book that covers items like above?
thanks
Jay
Quick start would be to double click the "button1" in designer view, which will generate a button1_click(...) event handler. In this routine, you could write one line of code:
Response.Redirect("~/form2.aspx");
To set Form1.aspx to your "homepage", it would make sense to rename it to "default.aspx" which is usally the page IIS looks for to start from.
hope it helps,
When publishing, in the IIS you have to make the default page the form1.aspx page. In your VS2010 just right click on the file and set it as start page.
Yes, the Response.Redirect answer posted is correct.
I've found that ASP.NET Unleashed is really helpful for beginners. You can find it on amazon:
http://www.amazon.com/ASP-NET-4-Unleashed-Stephen-Walther/dp/0672331128

using easyslider with asp.net to create a registration wizard

I am trying to make a registration wizard that contains about 6 steps.
I have moved away from using the standard asp.net registration wizard as I want more control over the look and feel.
I am using the easyslider plugin as I want a back and forward button that allows the users to click through the steps and be able to go back and forwards.
So everything was going well until a added an asp.net button into the plug. When I click it the page postback isnt happening, Does the plugin stop the ability to use asp.net controls inside? Is there something else I need to do to enable the click event to fire when using this plugin?
Any advise would be great!
Thank you
Make sure your button is registered properly (eg : with a runat="server") in the aspx file.
Did you try to move that button outside of your wizard ? I never used easyslider but I guess, like most sliders, it "just" hides or shows partial part of the page so I see nothing that could prevent a post back from happening.

How do I build a popup dialog in asp.net

I am building a Web Application using asp.net (C#). I come from windows forms development and find myself in a hard spot. Im making an application where the user should edit some simple information about himself, and thus i need to create a new dialog. How do I do that in asp.net? I have a button which event is handled serverside, and when i click lthis button i want to popup a dialog where i can show my custom web control (or any web control, lets make it generic from the start). How do I go about with doing so?
I got some part of the way by looking at the internet, that i need to make a section and set the z-index to 1000, but how do i make it visible (block)? Please help here as i am completely lost...
/H4mm3rHead
If you're not concerned about using a library, try Microsoft ASP.NET AJAX Control Toolkit, they have several controls that can create something you want (the ModalPopup control).
The AJAX Control Toolkit has a ConfirmButton extender which will do exactly what you are looking for.
I used to do the following:
1. my new pop up is just a new aspx page like any other page
2. add a button (or just a link) that fires a client side java script function
3. in the function I use window.open and put params to open my popup page with no toolbars or scrollbars and proper size to its content
check this for more info on #3

ASP.Net Onclick event doesn't work with ajaxcontroltoolkit

I designing a web application using vs2008 and c#.
I already have done many versions of it and all of them seems to be working fine.
Yesterday i decided to replace de vs calendar with a ajax calendar and to do so i used ajaxcontroltoolkit. The new calendar is also working fine.
But the buttons i have in my form stoped to work.
The onclick event just do nothing.
i've already change back to the older calendar and everything works ok.
The button calls a method on code behind.
So, any of you guys have a clue about what i'm doing wrong?
Is there other ways of doing this?
Tks in advance
thanks for yours answers
my problem is that i'm using this onsubmit="return setHourglass(); on my form so the user know when the page is waiting for a response.
Something like this:
Bellow the script code
function setHourglass() {
document.body.style.cursor = 'wait';
}
i removed that and is working ok, but i really don't know the motive for this behaviour :|

Resources