|
Public Shared Function AdvancedFindControl(ByVal Control As Me, ByVal controlId As String) As Control
Dim controlQueue As Queue = New Queue(New()
{
container
}
)
Dim currentControl As Control
While controlQueue.Count > 0
currentControl = controlQueue.Dequeue()
Dim child As Control
For Each child In currentControl.Controls
controlQueue.Enqueue(child)
Next
If currentControl.ID = controlId Then
Return currentControl
End If
End While
Return Nothing
End Function
|
|
|
|
|
This is not valid C# code - you're missing a type name after 'new':
...new Queue(new[] { container });
I would expect something like:
...new Queue(new Foo[] { container });
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
Java to VB & C# Converter: convert Java to VB or C#
|
|
|
|
|
Whoa ... posted too soon - this is valid C# syntax - I'm working on the VB equivalent - stay tuned.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
Java to VB & C# Converter: convert Java to VB or C#
|
|
|
|
|
Apparently, there is no VB equivalent to an inferred array initialization (e.g., "new[] {...}" in C#3)
The following was produced with Instant VB, with one manual adjustment - adding "Control" after the 'New':
<System.Runtime.CompilerServices.Extension> _
Public Shared Function AdvancedFindControl(ByVal container As Control, ByVal controlId As String) As Control
Dim controlQueue As New Queue(New Control() { container })
Dim currentControl As Control
Do While controlQueue.Count > 0
currentControl = controlQueue.Dequeue()
For Each child As Control In currentControl.Controls
controlQueue.Enqueue(child)
Next child
If currentControl.ID = controlId Then
Return currentControl
End If
Loop
Return Nothing
End Function
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
Java to VB & C# Converter: convert Java to VB or C#
|
|
|
|
|
Hi!!
I am using Javascript in user control.. My problem is i am not getting the value of textbox in javascript.
here is my code
function InputChange()
{
var ctl=document.getElementById('txtEmp').value;
alert(ctl);
}
<asp:TextBox ID="txtEmp" onchange="InputChange();" runat="server" CssClass="form_textbox" Width ="80px"></asp:TextBox>
its displaying 'ctl' value as 'null'
please help me ASAP...
Thanks in Advance...
|
|
|
|
|
Its because when you are using User Control or anything ASP genrate a unique client id to every control you are giving wrong i Id i guess
unction InputChange()
{
var ctl=document.getElementById("<%=txtEmp.ClientID %>").value;
alert(ctl);
}
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
modified on Tuesday, April 22, 2008 3:41 AM
|
|
|
|
|
Thanks a lot sandeep... its working.... thank u very much....
|
|
|
|
|
Most likely the id of the control on the emitted page is actually something like: ctl00_master_txtEmp or similar. Look at the source to find this: it is named after the parent element (such as the ContentPlaceHolderID). As an example right click this page, click view source and you will see many examples of this.
Your code would then be:
var ctl=document.getElementById('ctl00_master_txtEmp').value;<br />
alert(ctl);
|
|
|
|
|
Its better to give a client id dynamic instead of static
Check my above modified code that will work
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi,
I have 2 different database. Both are in mssql. I want code to map tables and columns of these two diferent databases.
Can u please help me?
Thanks and regards,
Arti Khachariya
|
|
|
|
|
|
Hello
how should i add the duplicate url in the web.sitemap file?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
try google first
"Your Web application will fail if you list a URL that does not exist, or if you list a duplicate URL. "
reference = http://msdn2.microsoft.com/en-us/library/ms178418.aspx
|
|
|
|
|
hai
I want to bind DataTextField and DataValueField for dropdownlist in code behind of asp.net application. anybody help..
Regards
M.Ramesh
|
|
|
|
|
I think this can be get from Google
Check google you will find n number of articles that will show this
this is basic, you need to learn how to learn
Let me know if you get any difficulties while implementing this
Atleast show some efforts
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hai friend,
I think that you didn't got my query. ie.if it is dataset means i will bind directly like mydataset.tables(0) like that but I am having data like "1,sandeep|2,Ramesh|3,Akhare". So I need to bind in the dropdownlist using for loop. I need answer for this..
Thanks & Regards
M.Ramesh
|
|
|
|
|
OK Its more simple just create a IDictionary with key values and bind that one to your drop downlist in page_init event like this
public class Test
{
public static IDictionary GetBusinessStates()
{
IDictionary StateTable = new System.Collections.Specialized.OrderedDictionary();
StateTable.Add(" ", "Select One");
StateTable.Add("Sa", "Sandeep");
StateTable.Add("Ra", "Ramesh");
StateTable.Add("Ak", "Akhare");
return StateTable;
}
}
Write this in Page_Init
DropDownList1.DataSource = Test.GetBusinessStates();
DropDownList1.DataTextField = "Value";
DropDownList1.DataValueField = "Key";
DropDownList1.DataBind();
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hai friend,
Thanks for your needful help. I need which namespace for IDictionary ie.using System.Collections like that..
Thanks & Regards
M.Ramesh.
|
|
|
|
|
Just use using System.Collections;
Let me know if your problem get resolved
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
The following is the code, iam getting error ie.specified cast is not valid..
Dim lDataRow() as DataRow
lDataRow = ldstDataset.Tables(2).Select("GroupID='" & lintGroupId & "'")
lDtTable = GetVouItems(lDataRow)
Public Function GetVouItems(ByVal pgDataRow() As DataRow) As IDictionary
Dim StateTable As New System.Collections.Specialized.NameValueCollection
Dim lDataRow() As DataRow
Dim lintCnt As Integer
lDataRow = pgDataRow
For lintCnt = 0 To lDataRow.Length - 1
StateTable.Add(lDataRow(lintCnt)(1), lDataRow(lintCnt)(2))
Next
Return StateTable
End Function
|
|
|
|
|
Sorry now i can't help you
As you have written in VB i don't understand its very difficult BOSS
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hai friend,
i can surely do it using ur concept..thanks a lot..
Regards
M.Ramesh
|
|
|
|
|
hai,
i am using somany code to send mail.but it dosenot work.if know the code replay to me..
|
|
|
|
|
sugunavathysubramanian wrote: i am using somany code to send mail
OK
sugunavathysubramanian wrote: but it dosenot work
Whats the problem you are facing ?
sugunavathysubramanian wrote: f know the code replay to me.
Ya i have your code in my machine Just saw in Google home Page
Just kidding How can we know without looking into the code
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
This is explicitly covered in the article I link to in my sig.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|