473,326 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

WebControls Collection

Ros
Group,
I would like to pass the webcontrol collection to a sub procedure. but every
time i try to access the Attributes of each webcontrol, it gives me an error

13 "Unable to cast object of type 'System.Web.UI.LiteralControl' to
type 'System.Web.UI.WebControls.WebControl'."

Sub Setup_DR(Optional ByVal pg As Web.UI.Page = Nothing)
Dim wCtl As Web.UI.WebControls.WebControl = Nothing
For Each wCtl In pg.Controls
If wCtl.Attributes("pTag").Contains(prm.Name) Then
End If
Next
End Sub

is there anyway to pass a collection of webcontrol to a procedure or ctype
the control to webcontrol?

Please help.
Thanks in advance.

Ros
Jul 14 '06 #1
1 2265
Ros
Peeps,

i had figured it out. Thanks for your help though.


Ros

"Ros" wrote:
Group,
I would like to pass the webcontrol collection to a sub procedure. but every
time i try to access the Attributes of each webcontrol, it gives me an error

13 "Unable to cast object of type 'System.Web.UI.LiteralControl' to
type 'System.Web.UI.WebControls.WebControl'."

Sub Setup_DR(Optional ByVal pg As Web.UI.Page = Nothing)
Dim wCtl As Web.UI.WebControls.WebControl = Nothing
For Each wCtl In pg.Controls
If wCtl.Attributes("pTag").Contains(prm.Name) Then
End If
Next
End Sub

is there anyway to pass a collection of webcontrol to a procedure or ctype
the control to webcontrol?

Please help.
Thanks in advance.

Ros
Jul 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rodrigo DeJuana | last post by:
Howdy, I'm new to this .net stuff and really have little to no training. Im trying to create a new page for a web form, so i have been pretty much jsut coping code. I having some issue with...
6
by: Richard | last post by:
Dim index As Integer = lbSysteem.FindStringExact(strSysteem) basicly i want to return the value but as the examples show on the MSDN library, nothings wrong with the code? if FindStringExact...
1
by: Rog | last post by:
Hello, Yesterday I downloaded IEwebcontrols.exe and TreeviewControl.msi from http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dnaspp/html/aspnet-...
2
by: Dexter | last post by:
Hello all, I have webform1, and i need to make a bow to catch all textbox in my webform1. I tray this, but don't function. Dim obj As System.Web.UI.WebControls.TextBox Dim cont As Integer For...
0
by: I am Sam | last post by:
Ok whats wrong with my toolbar? When I debug I don't get an error message and the databinding is working correctly but the toolbar itself and the <iewc:ToolbarDropDownlist /> control isn't showing...
3
by: Dotnet Gruven | last post by:
I've built a WebForm with a Table added dynamically in Page_Load when IsPostBack is false. The table includes a couple of TextBoxes, RadioButtonLists and CheckboxLists. On postback, those...
6
by: Steve | last post by:
I'm trying to iterate over all the form controls in my MasterPages content page. Basically, I've got dropdowns, textboxes, etc that I want to format in Page_Load() I've added this code to my...
2
by: ThunderMusic | last post by:
Hi, I have a custom WebControl. I fire an event and send, as the EventArg, another WebControl that contains sub controls (ParseChildren(true))... It can contain anything, but I want to find one...
0
by: marcyb | last post by:
Can anyone help I am trying to get a WebControl toolbar to work this is my code for a toolbar in visual web developement 2005 express for C# <%@ Page Language="C#" Debug="true" %> <%@ Import...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.