G
Guest
Hi Guys,
I am generating dynamic server controls using XML and
XSLT. With this I am generating two buttons which when
clicked redirect the page to a different page.
Here is my "checkout" button which is generated
dynamically looks something like this
<input type="image" name="checkout" id="checkout"
onClick="checkout_Click" src="images/checkout.jpg"
border="0" />
I have created code for the onClick event of the button in
the code-behind file, which looks like
public void checkout_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
Response.Write("Checkout clicked!");
Response.Redirect("checkout.aspx");
}
Now when I run the application, I can get my buttons
displayed properly but when button is clicked I get a
runtime script error saying:
checkout_Click not defined.
I want to mention again that the code which handles the
onClick event (checkout_Click) is written in the code-
behind file. Somehow this is not being recognized by
the .aspx file. Can anyone give me pointers on how to make
this recognise my code-behind methods?
Thanks in advance
I am generating dynamic server controls using XML and
XSLT. With this I am generating two buttons which when
clicked redirect the page to a different page.
Here is my "checkout" button which is generated
dynamically looks something like this
<input type="image" name="checkout" id="checkout"
onClick="checkout_Click" src="images/checkout.jpg"
border="0" />
I have created code for the onClick event of the button in
the code-behind file, which looks like
public void checkout_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
Response.Write("Checkout clicked!");
Response.Redirect("checkout.aspx");
}
Now when I run the application, I can get my buttons
displayed properly but when button is clicked I get a
runtime script error saying:
checkout_Click not defined.
I want to mention again that the code which handles the
onClick event (checkout_Click) is written in the code-
behind file. Somehow this is not being recognized by
the .aspx file. Can anyone give me pointers on how to make
this recognise my code-behind methods?
Thanks in advance