|
-
Oct 27th, 2006, 05:07 PM
#1
Thread Starter
Addicted Member
[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
-
Oct 27th, 2006, 08:27 PM
#2
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 30th, 2006, 04:29 PM
#3
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|