Home All Groups Group Topic Archive Search About
Author
28 Feb 2006 2:29 PM
HockeyFan
I've got a newbie question.  I'm new to ASP.Net and have a control that
someone else wrote that produces the following:

<td style="white-space:nowrap;"><input type="image" name="ctl00$btnSystem"
id="ctl00_btnSystem" src="../images/btnShortcutSystemOn.gif"
style="border-width:0px;" /></td>

If I want someone to be able to click on that image and take them to another
page, how's the best way to do that?  Redirection?  How specifically.  I'm
new to .Net.

I figure I'll have to write a handler that handles ctl00_btnSystem.click. 
Is this correct?  And what do I put inside the handler to take the browser to
the new page?

Author
28 Feb 2006 3:29 PM
Cor Ligthert [MVP]
Hockeyfan.

Are you using Visual Studio Net and code behind.

Than in the clickevent of that image which you have to set

Response.Redirect("~/default.aspx")

Be aware that you better can use an image button for this.

I hope this helps,

Cor





Show quoteHide quote
"HockeyFan" <Hockey***@discussions.microsoft.com> schreef in bericht
news:5CA1633D-35B4-4BA0-AE53-19AA0E6B610F@microsoft.com...
> I've got a newbie question.  I'm new to ASP.Net and have a control that
> someone else wrote that produces the following:
>
> <td style="white-space:nowrap;"><input type="image" name="ctl00$btnSystem"
> id="ctl00_btnSystem" src="../images/btnShortcutSystemOn.gif"
> style="border-width:0px;" /></td>
>
> If I want someone to be able to click on that image and take them to
> another
> page, how's the best way to do that?  Redirection?  How specifically.  I'm
> new to .Net.
>
> I figure I'll have to write a handler that handles ctl00_btnSystem.click.
> Is this correct?  And what do I put inside the handler to take the browser
> to
> the new page?
>
Author
28 Feb 2006 4:36 PM
Andrew Morton
HockeyFan wrote:
> I've got a newbie question.  I'm new to ASP.Net and have a control
> that someone else wrote that produces the following:
>
> <td style="white-space:nowrap;"><input type="image"
> name="ctl00$btnSystem" id="ctl00_btnSystem"
> src="../images/btnShortcutSystemOn.gif" style="border-width:0px;"
> /></td>
>
> If I want someone to be able to click on that image and take them to
> another page, how's the best way to do that?  Redirection?  How
> specifically.  I'm new to .Net.

As it's an <input>, it must be on a <form>. Do you want the form's action to
be processed, or are you trying to do
<a href="somewhere.html"><img src="../images/btnShortcutSystemOn.gif"
border="0"></a>

?

Andrew
Author
3 Mar 2006 9:59 AM
Armin Zingler
Show quote Hide quote
"HockeyFan" <Hockey***@discussions.microsoft.com> schrieb
> I've got a newbie question.  I'm new to ASP.Net and have a control
> that someone else wrote that produces the following:
>
> <td style="white-space:nowrap;"><input type="image"
> name="ctl00$btnSystem" id="ctl00_btnSystem"
> src="../images/btnShortcutSystemOn.gif"
> style="border-width:0px;" /></td>
>
> If I want someone to be able to click on that image and take them to
> another page, how's the best way to do that?  Redirection?  How
> specifically.  I'm new to .Net.
>
> I figure I'll have to write a handler that handles
> ctl00_btnSystem.click. Is this correct?  And what do I put inside
> the handler to take the browser to the new page?


I know VB.Net pretty good, but I know nothing about ASP.Net. Maybe you
should post to one of the ASP.Net groups:

microsoft.public.dotnet.framework.aspnet[.*]


Armin
Author
3 Mar 2006 11:12 AM
Cor Ligthert [MVP]
Armin,

Why
> microsoft.public.dotnet.framework.aspnet[.*]
>

This can be done pretty good with VB.Net code, as it can be done by other
code as well.

The solution given in the newsgroup ASPNET will most likely not be the same
as in VB.Net

Which depends if Visual Studio Net is used.

Cor