my understanding of the principles of this stuff are a bit vague so i
apologise in advance - sort of thrown in at the deep end. Anyway - I
am working on a project at the minute and i have created a button
using the following code.
<asp:button id="Button1" onclick="upload" runat="server" Width="119px"
text="Upload"></asp:button
this button calls and runs some code ie. sub upload - see below
Public Sub upload(ByVal s As Object, ByVal e As EventArgs)
i have created my own button in fireworks and want to insert it in my
code an call this function but it does not work - code below
<INPUT id="btn_EditImage" type="image" src="http://pics.10026.com/?src=Buttons/EditImage.gif"
onclick="upload" runat="server"></TD>.
i can change my button to a server control and call the function from
there but there is an issue with the arguments in the code. any ideas
appreciated .
CGcsgraham74@.hotmail.com (Colin Graham) wrote in
news:ee261922.0504191329.e596fac@.posting.google.co m:
> i have created my own button in fireworks and want to insert it in my
> code an call this function but it does not work - code below
> <INPUT id="btn_EditImage" type="image" src="http://pics.10026.com/?src=Buttons/EditImage.gif"
> onclick="upload" runat="server"></TD>.
The onClick method is for Javascript functions - not server side functions.
Since you're using fireworks for your button (it's a graphic right?) use an
imageButton instead of a regular .NET button. That'll allow you to bind the
button to .NET functions.
> i can change my button to a server control and call the function from
> there but there is an issue with the arguments in the code. any ideas
> appreciated .
--
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
thanks lucas ive tried that and the button works fine unfortunately i
now get the following error
Parser Error Message: The base class includes the field 'button1', but
its type (System.Web.UI.WebControls.Button) is not compatible with the
type of control (System.Web.UI.WebControls.ImageButton).
does this mean i have to change my asp.net function??
any help appreciated
CG
csgraham74@.hotmail.com (Colin Graham) wrote in
news:ee261922.0504210327.5bf5452f@.posting.google.c om:
> thanks lucas ive tried that and the button works fine unfortunately i
> now get the following error
> Parser Error Message: The base class includes the field 'button1', but
> its type (System.Web.UI.WebControls.Button) is not compatible with the
> type of control (System.Web.UI.WebControls.ImageButton).
> does this mean i have to change my asp.net function??
Check your codebehind... is button1 still declared as a
System.Web.UI.WebControls.Button not as a
System.Web.UI.WebControls.ImageButton? Make sure button one is declared as
a ImageButton.
Take a look at the "hidden" code VS.NET auto generates. Sometimes it
doesn't update the code properly.
--
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
No comments:
Post a Comment