CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_forms Tags:
Item Type: NewsGroup Date Entered: 9/28/2006 2:39:57 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 5 Views: 8 Favorited: 0 Favorite
6 Items, 1 Pages 1 |< << Go >> >|
tobba
Asp.Net User
Using imagebuttons. Passing data.9/28/2006 2:39:57 PM

0

Hi

I have a repeater that writes out datafields like this:

ID.Name 

1.blablablabla (Button: add to my favorites)

2.balblalblabl (Button: add to my favorites)

3.fdfdsafdfdsf (Button: add to my favorites)

 What i want is when i press this button (Button: add to my favorites) it Inserts the ID of the table row AND the UserID(This is for logged in members) into a new table called my favorites.

 Im using DotNetNuke.

 

Can someone please help me alittle? 

 How can i do this? examples?

 

Thanks 

Jasson_King
Asp.Net User
Re: Using imagebuttons. Passing data.9/29/2006 6:42:27 AM

0

I give you an example for your reference.Wish this help you.

<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
      <ItemTemplate>
          <asp:Label ID="_lbl_" runat="server" Text='<%# Eval("ID")%>'></asp:Label> 
          <asp:Repeater ID="_rep_catalog" runat="server"> 
          </asp:Repeater>
      </ItemTemplate>
      </asp:Repeater>


protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            Label lbl = (Label)e.Item..FindControl("_lbl_");  
            string id = lbl.Text;

            //Insert into database (ID,UserID)
        }
    }


Sincerely,
Jasson Wang
Microsoft Online Community Support

This posting is provided "AS IS" with no warranties, and confers no rights
tobba
Asp.Net User
Re: Using imagebuttons. Passing data.9/29/2006 9:06:53 AM

0

Thanks for the replay!

 

Can i insert a imagebutton there?  :

 <asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
      <ItemTemplate>
            //Imagebutton-----------------------------
            <asp:Label ID="_lbl_" runat="server" Text='<%# Eval("ID")%>'></asp:Label> 
              <asp:Repeater ID="_rep_catalog" runat="server"> 
              </asp:Repeater>
      </ItemTemplate>
      </asp:Repeater>
 

Every record willl get the same Label ID (ID="_lbl_"), does it reconize the one i press?

If i press record with ID=4 will it understand that?

 Using VB.NET
 

 

 

Jasson_King
Asp.Net User
Re: Using imagebuttons. Passing data.9/29/2006 9:15:43 AM

0

Yes,you can.It can recognize the ID of every row automatically.
Sincerely,
Jasson Wang
Microsoft Online Community Support

This posting is provided "AS IS" with no warranties, and confers no rights
tobba
Asp.Net User
Re: Using imagebuttons. Passing data.9/29/2006 9:18:03 AM

0

Thanks alot, ill try and see if i can get it to workSmile
tobba
Asp.Net User
Re: Using imagebuttons. Passing data.9/29/2006 11:42:49 AM

0

How can i put the data in to a DB using VB.net?

Im using codebehind and i dont understand how i can put data into a DB using VB.net. do i have to use <asp:ObjectDataSource> for that?

I used that before but from a formview.

This is how far i came: 

Sub ImageButton1_OnClick(ByVal sender As Object, ByVal e As ImageClickEventArgs)
query?

End Sub
 

Do i put the query in here? 

6 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
PHP 4: a beginner's guide Authors: Bill McCarty, Pages: 567, Published: 2001
Pure ASP.NET Authors: Robert Lair, Jason Lefebvre, Pages: 613, Published: 2002
Pro ASP.NET 2.0 in VB 2005 Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew Macdonald, Mario Szpuszta, Pages: 1288, Published: 2005

Web:
Passing data with image button via url query string - ASP.NET Forums I want the user to click it and send variable data via the query string to another page. ... 1 2 Passing data with Onclick from ImageButton - ASP.NET Forums How could I pass variable id with Onclick from ImageButton on ... WindowsClient: Using TableAdapters to Insert Related Data into an MS ...
How Do I pass Values into an imagebutton click event in c# ... Hi, Trying to pass some values into an imagebutton click event, ... Try using OnCommand instead of OnClick. Then you can specify values in the CommandName ...
Passing arguments to actions In the Button, Image Button, or Link builder call, pass "row" specific data, using the repeated region's Loop Variable (accessible through the Reference ...
Popup window on imagebutton click - Iron Speed Technical Forums I need to "Popup a window on imagebutton click event" and also passing some ... Here's one way to call a popup using an .ASPX page and parameters: ...







beta menu control - updated - this appears to be a bug!

masterpages and menuitems

edit of stylesheet does not change page

problem to use treeview control in a 'content page' this error occur "only content controls are allowed directly in a content page that contains content controls."

selected hyperlink will change color

only change content place placeholders content

menu overflow

xsl transform

unable to switch multiview in contentplaceholder in master page with dropdownlist control

treeview - onselectednodechanged

disabled design-time masterpage.

how can i trick the sitemappath?

asp:menu submenu display control

menu in masterpage. after rendering a specific webform content no itemclick event is ever fired again...

imagebutton and css

why some pages do not work if i am not logged in

javascript and treeview_togglenode

masterpage creating circular reference with rc1

master page and forms

master page class type error

using webpart zone controls in a master page

sharing master pages

master pages and javascript

load a stylesheet on control use

how can i access the property a control on a master page from the master page's code behind.

can i dynamically create and save aspx files that use master pages in code?

treeview using sitemap data source renders nothing, but looks good in design view ??

treemenu with sqlsitemapprovider + commandnotification

master page url rebasing/location problems

menu control - its impossible to select the leaf nodes

   
  Privacy | Contact Us
All Times Are GMT