[RESOLVED] Submit an imagebutton with a value?
I'm implementing a multilingual website and I have two flags that, when people click on them, submits the form and changes the language. I tried using the imagebutton but you can't assign a value to them. What do I need to use?
Here is the HTML...
HTML Code:
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" style="Z-INDEX: 101; LEFT: 8px; TOP: 8px" cellSpacing="0" cellPadding="0"
width="760" align="center" border="1" runat="server">
<TR>
<TD height="60">
<table cellpadding=0 cellspacing=0 border=0 width=756>
<tr>
<td>
<asp:label id="Label4" runat="server" ForeColor="Blue"> Enter Work Order Number (or click 'Find Work Order' button to look up from list)</asp:label>
</td>
<td align=right>
<asp:ImageButton ImageUrl="images/english.gif" ID="Language" runat=server /> <asp:ImageButton ImageUrl="images/french.gif" ID="ImageButton" runat=server />
</td>
</tr>
and on the server...
VB Code:
' check the querystring
If Request("Language") <> "" Then
sLanguage = Request("Language")
End If
Re: Submit an imagebutton with a value?
an Image btton can take a CommandName argument so you can receive this argument in your code behind and know which button was clicked.
Re: Submit an imagebutton with a value?
ImageButtons do have postback events. You have two separate image buttons. Give them proper IDs, like imgBtnEnglish and imgBtnFrench. Each will have a separate event, so clicking on imgBtnEnglish can raise the imgBtnEnglish's click event, in which you say, set a session variable to hold the current language.