Results 1 to 3 of 3

Thread: [RESOLVED] Submit an imagebutton with a value?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Posts
    205

    Resolved [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>&nbsp;
    					            </td>
    					            <td align=right>
    					                <asp:ImageButton ImageUrl="images/english.gif" ID="Language" runat=server />&nbsp;<asp:ImageButton ImageUrl="images/french.gif" ID="ImageButton" runat=server />
    					            </td>
    					        </tr>
    and on the server...

    VB Code:
    1. ' check the querystring
    2. If Request("Language") <> "" Then
    3.     sLanguage = Request("Language")
    4. End If

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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
  •  



Click Here to Expand Forum to Full Width