469,602 Members | 1,838 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,602 developers. It's quick & easy.

Button control


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
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message347224.html

Nov 18 '05 #1
5 1279
onclick="javascript:history.go(-1);"

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Justnew" <Ju************@mail.mcse.ms> wrote in message
news:Ju************@mail.mcse.ms...

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
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message347224.html

Nov 18 '05 #2
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.<functionToBeFiredWhenButt onIsClicked>);

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://www.cyfi.com/support/websuppo...ack_button.htm

HTH,
Mark Jen [MSFT]
--
Please reply in newsgroup.
This posting is provided "AS IS" with no warranties, and confers no rights.

"Justnew" <Ju************@mail.mcse.ms> wrote in message
news:Ju************@mail.mcse.ms...

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
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message347224.html

Nov 18 '05 #3

Let me explain more. This project is asp.net and I am using vb.net. No
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 An
inside this webform1.aspx I have this button (back, or home The aim i
to enable to navigate to the startpage. In windows application,
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:
*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.<functionToBeFiredWhenButt onIsClicked>);

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" <Ju************@mail.mcse.ms> wrote in message
news:Ju************@mail.mcse.ms...

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


------------------------------------------------------------------------
Posted via http://www.mcse.ms


------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message347224.html


Justne
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message347224.htm

Nov 18 '05 #4
Call Response.Redirect from your Button_Click Sub. Here is an 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 your program,
like yahoo.com)

Hope this helps,
"Justnew" <Ju************@mail.mcse.ms> wrote in message
news:Ju************@mail.mcse.ms...

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.

Mark Jen [MSFT] wrote:
*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.<functionToBeFiredWhenButt onIsClicked>);

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" <Ju************@mail.mcse.ms> wrote in message
news:Ju************@mail.mcse.ms...

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

------------------------------------------------------------------------
Posted via http://www.mcse.ms

------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message347224.html
*

Justnew
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message347224.html

Nov 18 '05 #5

Thank you Martha
It works thanks for the help
Martha[MSFT] wrote:
*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" <Ju************@mail.mcse.ms> wrote in message
news:Ju************@mail.mcse.ms...

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


------------------------------------------------------------------------
Posted via http://www.mcse.ms


------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message347224.html


Justne
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message347224.htm

Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

25 posts views Thread by KK | last post: by
8 posts views Thread by Zelin Lu | last post: by
1 post views Thread by Jeff Lynch | last post: by
5 posts views Thread by gregarican | last post: by
reply views Thread by guiromero | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.