Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Create DIV from Server Side

Posted on 2006-07-19
4
Medium Priority
?
2,101 Views
Last Modified: 2008-01-09
I am in need to create a DIV from server side.
If i create a new HTML generic control only a SPAN is created.
    (Dim A As New HtmlGenericControl)
So plz tell me what is the property to convert a SPAN to DIV?



0
Comment
Question by:pradeepsudharsan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:GavinMannion
ID: 17136546
Instead of creating a Div Control just create the HTML dynamically.

Dim myDiv as String
myDiv = "<div id='blah'>afjkhafja</div>"

Then bind that to a placeholder or label or Response.Write it
0
 
LVL 7

Author Comment

by:pradeepsudharsan
ID: 17137515
I tried the code
But i am in need to create a DIV .so that we could bind an user control in that DIV.

Dim cell As New HtmlTableCell
                Dim strdiv As String
                cell = Table1.Rows(0).Cells(0)
                strdiv = "<div id=" & "'div1'" & " style=" & "'Z-INDEX: 105; WIDTH: 100%; POSITION: absolute; HEIGHT: 100%'" & " runat=" & "'server'" & ">" & "</div>"
                cell.InnerHtml = strdiv
                Dim uc As UserControl
                Dim dv As New HtmlGenericControl
                uc = Page.LoadControl("UC.ascx")
                uc.Visible = True
                dv = CType(Table1.Rows(0).Cells(0).Controls.Item(0), HtmlGenericControl)
                dv.Controls.Add(uc)

0
 
LVL 7

Author Comment

by:pradeepsudharsan
ID: 17137536
sorry try this code.

Table1 is created in the design time itself.

Dim cell As New HtmlTableCell
                Dim strdiv As String
                cell = Table1.Rows(0).Cells(0)
                strdiv = "<div id=" & "'div1'" & " style=" & "'Z-INDEX: 105; WIDTH: 100%; POSITION: absolute; HEIGHT: 100%'" & " runat=" & "'server'" & ">" & "</div>"
                cell.InnerHtml = strdiv
                Dim uc As UserControl

                uc = Page.LoadControl("UC.ascx")
                uc.Visible = True
                Page.FindControl("div1").Controls.Add(uc)
0
 
LVL 15

Accepted Solution

by:
GavinMannion earned 2000 total points
ID: 17137541
Oh, Okay.

Then use a Panel.

Dim p as Panel
p.ID = "MyDiv";
p.Controls.Add(User Control);

me.Controls.Add(p)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question