Ask a Question related to ASP.NET General, Design and Development.
-
Kevin Spencer #1
Re: how to call a function in datalist edit mode
The "following procedure" you mentioned is structured like an Event Handler.
Is there some reason for this? Why don't you just leave off the Event
Handler parameters (which you don't seem to be using) and just call the Sub?
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
[url]http://www.takempis.com[/url]
Big things are made up of
lots of little things.
"buran" <buran@buran.com> wrote in message
news:OKJhjOqUDHA.2040@TK2MSFTNGP11.phx.gbl...As> Dear ASP.NET Programmers,
>
> Please consider the following code:
>
> Private Sub dliStayDetails_ItemDataBound(ByVal sender As Object, ByVal eidea> System.Web.UI.WebControls.DataListItemEventArgs) Handles
> dliStayDetails.ItemDataBound
>
> If e.Item.ItemType = ListItemType.EditItem Then
> Dim deleteButton As LinkButton
> deleteButton = CType(e.Item.FindControl("lnkDelDischarge"),
> LinkButton)
> End If
>
> End Sub
>
> I would like to call function whick deletes the contents of a textbox in
> datalist edit mode. I wrote the following procedure but I don't have an> how to call it.
>
> Sub ClearDischargeDate(ByVal sender As Object, ByVal e As
> DataListItemEventArgs)
> Dim txtDis As TextBox
> txtDis = CType(e.Item.FindControl("txtDisDate"), TextBox)
> txtDis.Text = ""
> End Sub
>
> Any suggestions? Thanks in advance,
> Buran
>
>
Kevin Spencer Guest
-
Edit button not converting to edit mode
I too had the same problem today. I've users set up as writers role to update content thru Contribute. We have two admins including my self. We... -
Edit button not converting to edit mode
I think i have found the solution to this. There is a a file called ccSentPublished1.xml that is located in C:\Documents and Settings\<user... -
Edit button not converting to edit mode
I am running into this issue. I am still trying to pinpoint what is causing it but am having a hard time. -
Would like to load a datagrid already in edit mode instead of having the user click the edit button
Now my asp.net datagrid shows an edit button and clicking it puts the datagrid in edit mode. I would like to: 1) possilby load the page already... -
datalist edit mode and javascript pop up calendar
Hi Check whether textbox control name is 'txtDischargeDate' or it contains automatically generated id? HTH Ravikanth return the selected -
buran #2
Re: how to call a function in datalist edit mode
Ok, I replaced the code with the following one as you said:
Sub ClearDischargeDate()
Dim txtDis As TextBox
txtDis =
CType(Page.FindControl("dliStayDetails").FindContr ol("txtDisDate"), TextBox)
txtDis.Text = ""
End Sub
Now, how can I call this code in the event mode of the datalist control?
Thanks for your help,
Buran
"Kevin Spencer" <kevin@takempis.com> wrote in message
news:uSAXEsrUDHA.1688@TK2MSFTNGP11.phx.gbl...to> Well, first of all, I'm still a bit confused as to why you made this as a
> Event Handler. Do you WANT it to handle an Event from the DataList? If so,
> just set it up to handle the event, and you're fine. Otherwise, you needthe> identify the DataList, and find the control as you would any other control
> in your Page.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> [url]http://www.takempis.com[/url]
> Big things are made up of
> lots of little things.
>
> "buran" <buran@buran.com> wrote in message
> news:OYRbErqUDHA.484@TK2MSFTNGP09.phx.gbl...> > Thanks, but how can I reference to the textbox in edit mode then?
> >
> > Buran
> >
> > "Kevin Spencer" <kevin@takempis.com> wrote in message
> > news:#R6cenqUDHA.2368@TK2MSFTNGP09.phx.gbl...> > Handler.> > > The "following procedure" you mentioned is structured like an Event> > > Is there some reason for this? Why don't you just leave off the Event
> > > Handler parameters (which you don't seem to be using) and just callByVal> > Sub?> > >
> > > --
> > > HTH,
> > >
> > > Kevin Spencer
> > > Microsoft MVP
> > > .Net Developer
> > > [url]http://www.takempis.com[/url]
> > > Big things are made up of
> > > lots of little things.
> > >
> > > "buran" <buran@buran.com> wrote in message
> > > news:OKJhjOqUDHA.2040@TK2MSFTNGP11.phx.gbl...
> > > > Dear ASP.NET Programmers,
> > > >
> > > > Please consider the following code:
> > > >
> > > > Private Sub dliStayDetails_ItemDataBound(ByVal sender As Object,textbox> e> > > As
> > > > System.Web.UI.WebControls.DataListItemEventArgs) Handles
> > > > dliStayDetails.ItemDataBound
> > > >
> > > > If e.Item.ItemType = ListItemType.EditItem Then
> > > > Dim deleteButton As LinkButton
> > > > deleteButton = CType(e.Item.FindControl("lnkDelDischarge"),
> > > > LinkButton)
> > > > End If
> > > >
> > > > End Sub
> > > >
> > > > I would like to call function whick deletes the contents of a> in> an> > > > datalist edit mode. I wrote the following procedure but I don't have>> >> > > idea
> > > > how to call it.
> > > >
> > > > Sub ClearDischargeDate(ByVal sender As Object, ByVal e As
> > > > DataListItemEventArgs)
> > > > Dim txtDis As TextBox
> > > > txtDis = CType(e.Item.FindControl("txtDisDate"), TextBox)
> > > > txtDis.Text = ""
> > > > End Sub
> > > >
> > > > Any suggestions? Thanks in advance,
> > > > Buran
> > > >
> > > >
> > >
> > >
> >
>
buran Guest



Reply With Quote

