.NETGURU
user controle
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcontrolsvb' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

siri siris
hi all

i have one user controle(x.ascx) which contains one
HtmlAnchor controle. for this HtmlAnchor controle i
have onserverclick event
and in that event i am initializing some
variables...and i registered that x.ascx in y.aspx web
page....here my problem is i
am not able to access variables which are initialized
in onserver click event from my y.aspx web form....i
don't know why...
please help me..
thanks
siri

__________________________________________________
Do You Yahoo!?
Got something to say? Say it better with Yahoo! Video Mail
http://mail.yahoo.com

Reply to this message...
 
    
siri siris
-- Moved from [aspngstart] to [aspngcontrolsvb] by Marcie Jones <Click here to reveal e-mail address> --

hi all

i have one usercontrole...
whcih contains one table data like below.

<td style="PADDING-TOP: 1px" id="ant"
bordercolor="#C0C0C0" align="center" width="6%"></td>

in that table data i want to add one 2 * 2 table
from onload event..so i wrote code like below...

Protected ant As New
System.Web.UI.HtmlControls.HtmlTableCell()

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
    Dim tt As New HtmlTable()
Dim j As Integer
Dim i As Integer
For j = 0 To 1
Dim r As New HtmlTableRow()
For i = 0 To 1
Dim c As New HtmlTableCell()
c.Controls.Add(New
LiteralControl("aaa"))
r.Cells.Add(c)
Next
tt.Rows.Add(r)
Next
ant.Controls.Add(tt)
End Sub

but it is not adding this 2*2 table...please help
me...

thanks
siri

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

Reply to this message...
 
    
Das (VIP)
Try the following:

1) Declare a Table tag such as

<table id="myTable" Border="1" runat="server" />

2) Then, try the following code to create columns and rows dynamically

Dim r As HtmlTableRow
Dim c As HtmlTableCell

' Cell 1
r = new HtmlTableRow()
r.BgColor = "Gainsboro"
c = new HtmlTableCell()
c.Controls.Add(new LiteralControl("cell1"))
r.Cells.Add(c)

' Cell 2
c = new HtmlTableCell()
c.BgColor = "Blue"
c.width="100"
c.Controls.Add(new LiteralControl("cell2"))
r.Cells.Add(c)

' Cell 3
c = new HtmlTableCell()
c.BgColor = "Red"
c.Controls.Add(new LiteralControl("cell3"))
r.Cells.Add(c)

' Put together the row
Table1.Rows.Add(r)

3) Then try the same thing in a for loop.

:-)
Das.

----- Original Message -----
From: "siri siris" <Click here to reveal e-mail address>
To: "aspngcontrolsvb" <Click here to reveal e-mail address>
Sent: Tuesday, February 19, 2002 4:15 PM
Subject: [aspngcontrolsvb] user controle

> -- Moved from [aspngstart] to [aspngcontrolsvb] by Marcie Jones
<Click here to reveal e-mail address> --
[Original message clipped]

_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com

Reply to this message...
 
    
siri siris
hi das

thanks for your reply....i want to add this table to
one existing table data...(i.e table inside td)...if
you know please let me know...

thanks
siri
--- Das <Click here to reveal e-mail address> wrote:
[Original message clipped]

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

Reply to this message...
 
    
Das (VIP)
There is an interesting property called innerHTML for almost all server
controls.
You may want to use this property to create HTML from the server side.

In your case, if you have a table declaration such as:

<table id="myTable" Border="1" runat="server" />

And then, if you have built the above dynamically, then you can retrieve the
innerHTML of
this table "myTable" such as

myTable.innerHTML

Then, you can assign this myTable.innerHTML to other table column such as:

c = new HtmlTableCell()
c.Controls.Add(new LiteralControl(myTable.innerHTML))
r.Cells.Add(c)

Note:
I haven't tried this, but I think that this will work. Let us know the
results.

:-)
Das.

-----Original Message-----
From: siri siris [mailto:Click here to reveal e-mail address]
Sent: Tuesday, February 19, 2002 5:23 PM
To: aspngcontrolsvb
Subject: [aspngcontrolsvb] Re: user controle

hi das

thanks for your reply....i want to add this table to
one existing table data...(i.e table inside td)...if
you know please let me know...

thanks
siri
--- Das <Click here to reveal e-mail address> wrote:
[Original message clipped]

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

| [aspngcontrolsvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcontrolsvb.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 
System.EventArgs
System.Object
System.Web.UI.HtmlControls.HtmlAnchor
System.Web.UI.HtmlControls.HtmlTable
System.Web.UI.HtmlControls.HtmlTableCell
System.Web.UI.HtmlControls.HtmlTableRow
System.Web.UI.LiteralControl




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification