C
Curt_C [MVP]
onclick="javascript:history.go(-1);"
*Hi Justnew,
If you are using ASP.NET, it sounds like you want to attach to th
OnClick
event of the button. If you are using VS.NET, you can do this easil
by
going go the design view, click on your button, go to the propertie
view
and select events. Then dobule click the blank to the right of th
"Click"
action.
Alternatively, you can add this code in your code-behind...
In InitializeComponent():
this.<Button Variable Name>.Click += new
System.EvenHandler(this.<functionToBeFiredWhenButtonIsClicked>);
private void <functionToBeFiredWhenButtonIsClicked>(object sender,
System.EventArgs e)
{
// you can do anything you want in here, including navigate the use
to
other places using Response.Redirect.
}
Also, if you just want a "Back" button, then you can use client-sid
HTML
and JScript to achieve the same thing. Here's a link on it:
http://tinyurl.com/2wnya
HTH,
Mark Jen [MSFT]
--
Please reply in newsgroup.
This posting is provided "AS IS" with no warranties, and confers n
rights.
Justnew said:I have a button in my webform.aspx
And I have a htm document or page. What I want is that when I clic on
the button I want to display the htm page. In other words it i just a
back button
Need help
thanks in advance
Justnew
Justnew said:Let me explain more. This project is asp.net and I am using vb.net. Now
the start page is welcome.htm and here I have a link to webform1.aspx.
Now when I click on the link it takes me to the webform1.aspx And
inside this webform1.aspx I have this button (back, or home The aim is
to enable to navigate to the startpage. In windows application, I
usually double click on the button and enter this code like:
dim frm as new form1
frm.show
in asp.net I can not do that I tried to
dim frm as new htmlform
frm ="welcome.htm"
I am geting this annoying blue line on the code.
*Hi Justnew,
If you are using ASP.NET, it sounds like you want to attach to the
OnClick
event of the button. If you are using VS.NET, you can do this easily
by
going go the design view, click on your button, go to the properties
view
and select events. Then dobule click the blank to the right of the
"Click"
action.
Alternatively, you can add this code in your code-behind...
In InitializeComponent():
this.<Button Variable Name>.Click += new
System.EvenHandler(this.<functionToBeFiredWhenButtonIsClicked>);
private void <functionToBeFiredWhenButtonIsClicked>(object sender,
System.EventArgs e)
{
// you can do anything you want in here, including navigate the user
to
other places using Response.Redirect.
}
Also, if you just want a "Back" button, then you can use client-side
HTML
and JScript to achieve the same thing. Here's a link on it:
http://tinyurl.com/2wnya
HTH,
Mark Jen [MSFT]
--
Please reply in newsgroup.
This posting is provided "AS IS" with no warranties, and confers no
rights.
Justnew said:I have a button in my webform.aspx
And I have a htm document or page. What I want is that when I click on
the button I want to display the htm page. In other words it is just a
back button
Need help
thanks in advance
Justnew
------------------------------------------------------------------------
Justnew
Martha said:*Call Response.Redirect from your Button_Click Sub. Here is a
example:
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Redirect(http://localhost/Welcome.html);
}
You can redirect to any page (even those which don't belong to you
program,
like yahoo.com)
Hope this helps,
Justnew said:Let me explain more. This project is asp.net and I am using vb.net Now
the start page is welcome.htm and here I have a link t webform1.aspx.
Now when I click on the link it takes me to the webform1.aspx And
inside this webform1.aspx I have this button (back, or home The ai is
to enable to navigate to the startpage. In windows application, I
usually double click on the button and enter this code like:
dim frm as new form1
frm.show
in asp.net I can not do that I tried to
dim frm as new htmlform
frm ="welcome.htm"
I am geting this annoying blue line on the code.
Mark Jen [MSFT] wrote:
Justnew
------------------------------------------------------------------------