Ask a Question related to ASP.NET Security, Design and Development.
-
Sulafa Malik #1
custom controls
Hi all,
Could someone helps, I have created a custom web control, by creating a dll
, however when painting the control on the test form it appears ok but when
running the test form control doesnt appear ??
Thanks
Sulafa Malik Guest
-
communication between an application, custom controls, and user controls
Hi, and many thanks in advance... I'm a little lost about how to proceed with communication between an application, custom controls, and user... -
Why the properties of web user controls which inherted from my custom base UI controls MISSED?
Why the properties of web user controls which inherted from my custom base UI controls MISSED? How should I to set enable? -
Custom controls that contain other controls
Okay... maybe this has been done. I hate the Microsoft Tab and Multipage controls. So I'm building my own Tabstrip control. The style and DHTML... -
ASP.Net custom controls don't appear
I'm trying to get custom controls to work in Dreamweaver (NOT user controls). We purchased some Infragistics custom controls and I'm trying out... -
Accessing Properties of Custom Controls child Controls
I am using a Custom Control on a page which renders a button control if required. I need to access the child button control's properties (i.e.... -
vijaya #2
custom controls
I'm a learner of ASP.Net.
I want to try out a custom control of my own.
I'm not getting a clear of how to add my own properties to
the control apart from the common properties like text,
color, font etc..
How should I design a html tag with a complete new
property?
I need good materials on custom controls.
Plz help me out.
thanks in advance,
vijaya
vijaya Guest
-
Victor Garcia Aprea [MVP] #3
Re: custom controls
Hi vijaya,
You can get a good jumpstart with tutorials offered by sites like
[url]www.asp.net[/url] and [url]www.gotdotnet.com[/url]
--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
[url]http://obies.com/vga/blog.aspx[/url]
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
"vijaya" <anonymous@discussions.microsoft.com> wrote in message
news:0ccf01c3adcb$70559890$a101280a@phx.gbl...>
> I'm a learner of ASP.Net.
> I want to try out a custom control of my own.
>
> I'm not getting a clear of how to add my own properties to
> the control apart from the common properties like text,
> color, font etc..
>
> How should I design a html tag with a complete new
> property?
>
> I need good materials on custom controls.
> Plz help me out.
>
> thanks in advance,
> vijaya
Victor Garcia Aprea [MVP] Guest
-
josema #4
Custom controls
Hi to all,
this is my question....
Webcontrol1
________________________
| |
|initialize component |
| button +=new event..... |
| controls.add(button) |
| |
|event onclick |
| -control.add(webcontrol2) |
----------------------------------
webcontrol2
_____________________________
| |
| InitializeComponent |
| button2 +=new EventHandler...|
| -controls.add(textbox) |
| -controls.add(button2) |
| Onlclick |
| Response.write("hello") |
-----------------------------------------
The problem its that the webcontrol2 when you cick the button2 and the textbox dissapear from the webcontrol1 and dont show the word "hello"
thanks in advance
josema.
josema Guest
-
Victor Garcia Aprea [MVP] #5
RE: Custom controls
Hi Josema
What is happening is that you're creating a child control only in a click event of a button; so if you cause a postback by clicking any other button (or control) than the original button, the code that creates that first button will never execute and will "dissapear"
--
Victor Garcia Apre
Microsoft MVP | ASP.NE
Looking for insights on ASP.NET? Read my blog
[url]http://obies.com/vga/blog.asp[/url]
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
Victor Garcia Aprea [MVP] Guest
-
Josema #6
RE: Custom controls
How could i solve this??, i have to generate some textboxes dinamically (depends of a number), after the pressing of a button..
Josema
Josema Guest
-
Alessandro Zifiglio #7
Re: Custom controls
hi Josema, I had posted a workaround a few weeks ago in this forum. Follow
up on that post and see if you are able to resolve. I have tested and it
works nicely. Look at the last post in particular.
[url]http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=ImVLb.1434%24nC1.287%40news.edisontel.co m&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3DAdd%2Bcontrol%2Bto%2Basp%253APlaceHolder%2 Bon%2Basp.net%2Bpage%2Bfrom%2Buser%2Bcontrol[/url]
"Josema" <anonymous@discussions.microsoft.com> wrote in message
news:1CCB4128-6E7F-4466-857F-2D07F52FF1FB@microsoft.com...(depends of a number), after the pressing of a button...> How could i solve this??, i have to generate some textboxes dinamically> Josema
Alessandro Zifiglio Guest
-
Josema #8
Re: Custom controls
Thanks Alessandro, for your fast reply..
Could i use a placeholder?... cause i have to load a web custom control..
i cant use this line, cause i dont have a user control...
c1 = LoadControl("webusercontrol2.ascx"
Josem
----- Alessandro Zifiglio wrote: ----
hi Josema, I had posted a workaround a few weeks ago in this forum. Follo
up on that post and see if you are able to resolve. I have tested and i
works nicely. Look at the last post in particular
[url]http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=ImVLb.1434%24nC1.287%40news.edisontel.co m&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3DAdd%2Bcontrol%2Bto%2Basp%253APlaceHolder%2 Bon%2Basp.net%2Bpage%2Bfrom%2Buser%2Bcontro[/url]
"Josema" <anonymous@discussions.microsoft.com> wrote in messag
news:1CCB4128-6E7F-4466-857F-2D07F52FF1FB@microsoft.com..(depends of a number), after the pressing of a button..> How could i solve this??, i have to generate some textboxes dinamicall> Josem
Josema Guest
-
Alessandro Zifiglio #9
Re: Custom controls
if its a custom control just add it like you always did. The placeholder and
usercontrols scenario etc is specific to that particular user who posted his
problem. All you need to do is use that same logic, that is the viewstate
and how its being applied in pageload. If you look at the code, when the
button is being clicked that adds controls to the page, a flag is set in
viewstate, and you use that same flag in the page_load method to add the
control if it had already been added. Also move your logic for adding
controls to the page_load sub and not init, viewstate is available when
page_load fires ;)
Let me know if your having difficulty ;P
"Josema" <anonymous@discussions.microsoft.com> wrote in message
news:7F24DA0F-0F6A-4BDF-AB16-7E0A90E10996@microsoft.com...Follow> Thanks Alessandro, for your fast reply...
>
> Could i use a placeholder?... cause i have to load a web custom control...
>
> i cant use this line, cause i dont have a user control....
> c1 = LoadControl("webusercontrol2.ascx")
>
> Josema
>
> ----- Alessandro Zifiglio wrote: -----
>
> hi Josema, I had posted a workaround a few weeks ago in this forum.it> up on that post and see if you are able to resolve. I have tested and[url]http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=ImVLb.1434%24nC1.287%40news.edisontel.co m&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3DAdd%2Bcontrol%2Bto%2Basp%253APlaceHolder%2 Bon%2Basp.net%2Bpage%2Bfrom%2Buser%2Bcontrol[/url]> works nicely. Look at the last post in particular.
>
>dinamically>
> "Josema" <anonymous@discussions.microsoft.com> wrote in message
> news:1CCB4128-6E7F-4466-857F-2D07F52FF1FB@microsoft.com...> > How could i solve this??, i have to generate some textboxes> (depends of a number), after the pressing of a button...>> > Josema
>
>
Alessandro Zifiglio Guest
-
Alessandro Zifiglio #10
Re: Custom controls
almost forgot -- use a placeholder if you want your controls to go at a
specific location on the page.
"Alessandro Zifiglio" <alessandrozifiglio@NO-SPAM-hotmail.com> wrote in
message news:eF9Rb.7698$nC1.5757@news.edisontel.com...and> if its a custom control just add it like you always did. The placeholderhis> usercontrols scenario etc is specific to that particular user who postedcontrol...> problem. All you need to do is use that same logic, that is the viewstate
> and how its being applied in pageload. If you look at the code, when the
> button is being clicked that adds controls to the page, a flag is set in
> viewstate, and you use that same flag in the page_load method to add the
> control if it had already been added. Also move your logic for adding
> controls to the page_load sub and not init, viewstate is available when
> page_load fires ;)
>
> Let me know if your having difficulty ;P
>
> "Josema" <anonymous@discussions.microsoft.com> wrote in message
> news:7F24DA0F-0F6A-4BDF-AB16-7E0A90E10996@microsoft.com...> > Thanks Alessandro, for your fast reply...
> >
> > Could i use a placeholder?... cause i have to load a web customand> Follow> >
> > i cant use this line, cause i dont have a user control....
> > c1 = LoadControl("webusercontrol2.ascx")
> >
> > Josema
> >
> > ----- Alessandro Zifiglio wrote: -----
> >
> > hi Josema, I had posted a workaround a few weeks ago in this forum.> > up on that post and see if you are able to resolve. I have tested[url]http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=ImVLb.1434%24nC1.287%40news.edisontel.co m&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3DAdd%2Bcontrol%2Bto%2Basp%253APlaceHolder%2 Bon%2Basp.net%2Bpage%2Bfrom%2Buser%2Bcontrol[/url]> it>> > works nicely. Look at the last post in particular.
> >
> >> dinamically> >
> > "Josema" <anonymous@discussions.microsoft.com> wrote in message
> > news:1CCB4128-6E7F-4466-857F-2D07F52FF1FB@microsoft.com...> > > How could i solve this??, i have to generate some textboxes>> > (depends of a number), after the pressing of a button...> >> > > Josema
> >
> >
>
Alessandro Zifiglio Guest
-
Alessandro Zifiglio #11
Re: Custom controls
oops, I didnt realize you were adding those controls inside a custom web
control, i was under the impression that this was all going on in your
webform. Should still work, however using a placeholder here is useless.
There is no page_load method too, still you should still be able to use
viewstate and apply that logic. You might want to use the viewstate in your
CreateChildControls method, Viewstate is already available to you at this
time.
so it is :
1. when button is clicked add your child controls to your customwebcontrols
collection.
2. right after you add the controls, set a flag in viewstate --so after a
postback you can use this flag to check and see if these child controls had
been added.
3. in your createchildcontrols method check for this flag in viewstate and
if it is set, then call your method that adds your child controls,
recreating them again after postback.
"Alessandro Zifiglio" <alessandrozifiglio@NO-SPAM-hotmail.com> wrote in
message news:gI9Rb.7700$nC1.5499@news.edisontel.com...viewstate>
> almost forgot -- use a placeholder if you want your controls to go at a
> specific location on the page.
>
>
> "Alessandro Zifiglio" <alessandrozifiglio@NO-SPAM-hotmail.com> wrote in
> message news:eF9Rb.7698$nC1.5757@news.edisontel.com...> and> > if its a custom control just add it like you always did. The placeholder> his> > usercontrols scenario etc is specific to that particular user who posted> > problem. All you need to do is use that same logic, that is theforum.> control...> > and how its being applied in pageload. If you look at the code, when the
> > button is being clicked that adds controls to the page, a flag is set in
> > viewstate, and you use that same flag in the page_load method to add the
> > control if it had already been added. Also move your logic for adding
> > controls to the page_load sub and not init, viewstate is available when
> > page_load fires ;)
> >
> > Let me know if your having difficulty ;P
> >
> > "Josema" <anonymous@discussions.microsoft.com> wrote in message
> > news:7F24DA0F-0F6A-4BDF-AB16-7E0A90E10996@microsoft.com...> > > Thanks Alessandro, for your fast reply...
> > >
> > > Could i use a placeholder?... cause i have to load a web custom> > >
> > > i cant use this line, cause i dont have a user control....
> > > c1 = LoadControl("webusercontrol2.ascx")
> > >
> > > Josema
> > >
> > > ----- Alessandro Zifiglio wrote: -----
> > >
> > > hi Josema, I had posted a workaround a few weeks ago in this[url]http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=ImVLb.1434%24nC1.287%40news.edisontel.co m&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3DAdd%2Bcontrol%2Bto%2Basp%253APlaceHolder%2 Bon%2Basp.net%2Bpage%2Bfrom%2Buser%2Bcontrol[/url]> and> > Follow> > > up on that post and see if you are able to resolve. I have tested>> > it> >> > > works nicely. Look at the last post in particular.
> > >
> > >>> > dinamically> > >
> > > "Josema" <anonymous@discussions.microsoft.com> wrote in message
> > > news:1CCB4128-6E7F-4466-857F-2D07F52FF1FB@microsoft.com...
> > > > How could i solve this??, i have to generate some textboxes> >> > > (depends of a number), after the pressing of a button...
> > > > Josema
> > >
> > >
> > >
> >
>
Alessandro Zifiglio Guest
-
Alessandro Zifiglio #12
Re: Custom controls
You are welcome, josemari.
Postback if your having difficulty ;)
"josema" <anonymous@discussions.microsoft.com> wrote in message
news:6569F5D9-E1F9-449D-BBAD-B3C89EC51B45@microsoft.com...viewstate can be very useful...> Thanks Alessandro, i will test the instructions that you give me...
> Thanks for your time, it was very interesting to me, and i see that the> Regards.
> Josema.
Alessandro Zifiglio Guest
-
Wannabe_Geek #13
Custom Controls
Hi
Iam new to MS .Net technology just getting along with it....I created a custom control ,which takes in a query and displays the data in a tabular format....something similar to a datagrid.
Since its a custom Control I drag and drop and use it in my Pages. I overload the render method of my Custom Control and I pass the data that is to be displayed.
Now there is a requisite I have to add a Control ( Say for ex a Dropdown List box)
Could you please suggest me how do I add a Web-Control dynamically from a Custom -Control.
And someone could please suggest the difference between
A web ( server Control and a Custom Control).
Wannabe_Geek Guest
-
Mike Bell #14
Re: Custom Controls
I would say create a public property to your grid control that lets it know
whether to add your DDL control or not. Add your DDL control in the
CreateChildControls section of your grid control, based on that property
value. Does that make sense?
"Wannabe_Geek" <Wannabe_Geek@discussions.microsoft.com> wrote in message
news:969559D6-D859-49E6-B89D-805E8D3AAFE0@microsoft.com...custom control ,which takes in a query and displays the data in a tabular> Hi
> Iam new to MS .Net technology just getting along with it....I created a
format....something similar to a datagrid.overload the render method of my Custom Control and I pass the data that is>
> Since its a custom Control I drag and drop and use it in my Pages. I
to be displayed.List box)>
> Now there is a requisite I have to add a Control ( Say for ex a DropdownCustom -Control.> Could you please suggest me how do I add a Web-Control dynamically from a>
> And someone could please suggest the difference between
> A web ( server Control and a Custom Control).
>
Mike Bell Guest



Reply With Quote

