Re: Dynamically add link button
From: Martin Dechev (detcheff__at_hotmail.com)
Date: 04/20/04
- Next message: S. Justin Gengo: "Re: Dynamically add link button"
- Previous message: S. Justin Gengo: "Re: Advice: datagrid for news module"
- In reply to: simon: "Re: Dynamically add link button"
- Next in thread: S. Justin Gengo: "Re: Dynamically add link button"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 20 Apr 2004 16:37:19 +0200
Hi, Simon,
See inline
"simon" <simon.zupan@stud-moderna.si> wrote in message
news:#vlUlJuJEHA.892@TK2MSFTNGP09.phx.gbl...
> I have dataRepeater and ItemTemplate:
>
> <itemTemplate>
> <%# writeLine(0,DataBinder.Eval(Container.DataItem,
> "ts_id"),DataBinder.Eval(Container.DataItem, "timeStart"))%>
> </itemTemplate>
>
> In write line function I check if there exsists something and if it does,
I
> would like to add linkButton else something else.
> When user clicks this button some pannel will show and so on.
>
> Is there some other way?
>
For me it is easier to have the linkbutton and "the other thing" ready. Just
set their visibilities and properties. But maybe in your case it is
something more complex, so if it works this way - fine.
> Second question.
>
> I have couple lists of codes. When user clicks the button, Iwould like to
> show this codes to him in some combo box.
> Then he choose one and codes dissapear.
>
> I can do that like combo box on panel and set panel's visibility to
> false.When user click the button set visibility to true and when choose
the
> code set visibility again to false.But that means that every time user
want
> this page all my lists must be loaded to him.
If the panel is Visible = false, it and all its child controls are not
rendered to the client, so there will be no load.
On the button click load the DropDownList with the values and set the panel
Visible=true. Then on the DropDownList SelectedIndexChanged event set it
Visible = false again.
Hope this helps
Martin
> That means slow page. I can do
> that dynamically and load this scripts to him only when user click buton
or
> with javaScript and window.open method.
>
> Is there some other method?
>
> Thank you,
> Simon
>
> But dynamically, this won't work
>
> "Martin Dechev" <detcheff_@hotmail.com> wrote in message
> news:%23GodB5tJEHA.892@TK2MSFTNGP09.phx.gbl...
> > Hi, Simon,
> >
> > You should add the control independant on IsPostBack. i.e.:
> >
> > "simon" <simon.zupan@stud-moderna.si> wrote in message
> > news:uwqHAltJEHA.620@tk2msftngp13.phx.gbl...
> > > On code behind file:
> > >
> > > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > > System.EventArgs) Handles MyBase.Load
> >
> > ' If Not Page.IsPostBack Then
> >
> > > Dim ctrl As New LinkButton
> > > ctrl.ID = "link1"
> > > ctrl.Text = "link create"
> > > ctrl.CommandArgument = "myargument"
> > > ctrl.CommandName = "mycommandname"
> > > AddHandler ctrl.Click, AddressOf link_button_click
> > > plcCategory.Controls.Add(ctrl)
> >
> > ' End If
> >
> > > End Sub
> >
> > IMO a more appropriate place to dynamically add controls is the
Page_Init
> > automatic handler or overriding the protected Contsruct method.
> >
> > Hope this helps
> > Martin
> >
> > >
> > > Sub link_button_click(ByVal sender As Object, ByVal e As
> System.EventArgs)
> > > Response.Write("test")
> > > End Sub
> > >
> > > AND page:
> > >
> > > <form id="Form1" method="post" runat="server">
> > > <asp:PlaceHolder ID="plcCategory"
Runat="server"></asp:PlaceHolder>
> > > </form>
> > >
> > > What is wrong here?
> > > I would like to dynamically add more link buttons. Here is example for
> one
> > > and click event doesn't work.
> > > All link buttons should use link_button_click event.
> > >
> > > Thank you,
> > > Simon
> > >
> > >
> >
>
>
- Next message: S. Justin Gengo: "Re: Dynamically add link button"
- Previous message: S. Justin Gengo: "Re: Advice: datagrid for news module"
- In reply to: simon: "Re: Dynamically add link button"
- Next in thread: S. Justin Gengo: "Re: Dynamically add link button"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|