6 Replies - 1225 Views - Last Post: 09 September 2012 - 08:46 PM Rate Topic: -----

#1 kukuviza  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 08-August 12

Dynamic asp component with asp children

Posted 05 September 2012 - 09:49 AM

Hello, I am stuck with this problem here.
I would like to reproduce several orderlines to represent the items that are currently in a basket
I had imagined that I would have a structure like this

<ul>
 <li data-icon="delete">
    <a href="#"><img src="images/1.jpg" /></a>
    <strong>Product Name</strong>
    <br />
     <div style="float:left" >
         <input value="2">              
         <span style="padding-left:10px;position:relative;top:7px; font-weight:bold; font-size:15px;">Price</span><br />
      </div><br /><div class="clear:both;"> 
   </div> 
</li>




At first I used a literal and put all the information above in a dynamic way.
The problem arises when I need to check the input text. I have to check to see if there is a number in it, and then I need to retrieve that value to update the basket.
It appears that literals cannot have children controls.
So I managed to add dynamic literals and dynamic textboxes and managed to have them one near the other. This solutions however isn't satisfactory because i am quite limited in placing the object in the right.
For example, I have to put the input text immediately on the left of the price (but this is inside the literal). It is difficult to place objects also because all my measures are in % , and also impossible to use absolute positioning because all these boxes and literals are in the same big container. I would like to have a different container for every literal and his textbox.

In the end the question is: is there an asp object that allows asp children? I would create one div, place an asp image inside, some asp labels and the asp textbox. is it impossible?
Thanks in advance

Is This A Good Question/Topic? 0
  • +

Replies To: Dynamic asp component with asp children

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9088
  • View blog
  • Posts: 34,139
  • Joined: 12-June 08

Re: Dynamic asp component with asp children

Posted 05 September 2012 - 10:04 AM

Moving to ASP.NET
Was This Post Helpful? 0
  • +
  • -

#3 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 444
  • View blog
  • Posts: 1,492
  • Joined: 28-April 09

Re: Dynamic asp component with asp children

Posted 05 September 2012 - 02:52 PM

If these are databound controls you might could use something like the form iew or listview controls.
Was This Post Helpful? 0
  • +
  • -

#4 kukuviza  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 08-August 12

Re: Dynamic asp component with asp children

Posted 06 September 2012 - 01:53 AM

Well, I fill them with data sessions, or strings.
i tried now with a view but it said that I needed a multiview component.
Now I am currently trying with a panel, I don't know why I had underestimated panels, but it appears they are doing the trick. I am able to put html code inside and also attach asp component in it. What I have obtained now is not so bad.
Another problem though, I have some troubles in placing the panels. I attach them to a form in position 1 (with AddAt) but they always go inside a certain div, I don't know why. It is not even the first div of the form. I had prepared another div, just in case, but these panels insist on placing themselves in a certain div. Why is that?
Was This Post Helpful? 0
  • +
  • -

#5 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 444
  • View blog
  • Posts: 1,492
  • Joined: 28-April 09

Re: Dynamic asp component with asp children

Posted 06 September 2012 - 04:24 AM

the panel is displayed as a div in the html. If you're looking for a control that you can just dynamically add random controls to look at the PlaceHolder control, that's what it's for.

PlaceHolder Control

This post has been edited by Nakor: 06 September 2012 - 04:25 AM

Was This Post Helpful? 0
  • +
  • -

#6 kukuviza  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 08-August 12

Re: Dynamic asp component with asp children

Posted 09 September 2012 - 07:02 AM

but how can I add also html text to the placeholder? with the panel I called the property GroupingText.
Was This Post Helpful? 0
  • +
  • -

#7 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 444
  • View blog
  • Posts: 1,492
  • Joined: 28-April 09

Re: Dynamic asp component with asp children

Posted 09 September 2012 - 08:46 PM

dynamically create a LiteralControl and add it to the placeholder control along with whatever other controls you're adding

This post has been edited by Nakor: 09 September 2012 - 08:47 PM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1