I am new in csharp and asp.net, I am writing an web application with asp.net and csharp, anyway;
In my default.aspx I have button, if I click the button I want to open different page(e.g. asdfg.aspx). To do this I write this code in default.aspx:
<asp:Button ID="button1" runat="server" Text="Click Button" OnClick="ButtonClick" />
in my default.aspx.cs I created this code segment:
public void ButtonClick(Object sender, EventArgs e)
{
}
After that what can I do? Thanks
p.s.Sorry for my english.
Just a notice: the handle shouldn’t be a public method, it’t very unusual to instantiate the Page class and call it from another class. So you can make it protected or private.
The tilda notation (prefix) “~” is special in ASP .Net. It means the new location is related to the application which can differ by the website root. An website can have multiple applications (ie, you can have the main site and another “subsite” called admin). If you would be inside the admin application ASP .Net knows how to build the new location related to admin and not to the root website.