473,672 Members | 2,568 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Execute/Evaluate String in Asp.Net 1.1 using Vb.Net ?

Hi all,
I want to execute a String that is generated at Runtime and fills data in
DropDownList Controls at Runtime. I want to do this at server side. As Eval
functions works as client side function and there is not other function or
command to do this
example is here..
("ddlSub" & CStr(nRow) & ".DataSourc e = dtrSubject")
I want to evaluate this string to get name of control at runtime e.g.
ddlSub1, ddlSub2, ddlSub3 and so on

How it will be done using Asp.Net 1.1 using Vb.Net ?

TIA
Nov 19 '05 #1
2 2775
You can do a Page.FindContro l("CONTROL_ID") ;

note though that this isn't a recursive find (like client-side
getElementById( )

for example, say the control you wanted was inside a placeholder:
<asp:placeholde r id="plc" runat="server">
<asp:dropdownli st id="ddl" runat="server">
</asp:placeholder >

rather, you'll need to eitehr nest them:
Page.FindContro l("plc").FindCo ntrol("ddl")

or base it off the parent control:
ddlontrol.FindC ontrol("ddl")
of course, if the control isn't nested, you can just do
Page.FindContro l("ControlId" ) and ignore everything I said except the first
line (Which is the same as this line!!)
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"Kamal Ahmed" <mh********@yah oo.com> wrote in message
news:ex******** ******@TK2MSFTN GP09.phx.gbl...
Hi all,
I want to execute a String that is generated at Runtime and fills data in
DropDownList Controls at Runtime. I want to do this at server side. As
Eval functions works as client side function and there is not other
function or command to do this
example is here..
("ddlSub" & CStr(nRow) & ".DataSourc e = dtrSubject")
I want to evaluate this string to get name of control at runtime e.g.
ddlSub1, ddlSub2, ddlSub3 and so on

How it will be done using Asp.Net 1.1 using Vb.Net ?

TIA

Nov 19 '05 #2
Eval is a server side function. it is evaluated and executed in the server.

"Kamal Ahmed" <mh********@yah oo.com> wrote in message
news:ex******** ******@TK2MSFTN GP09.phx.gbl...
Hi all,
I want to execute a String that is generated at Runtime and fills data in
DropDownList Controls at Runtime. I want to do this at server side. As Eval functions works as client side function and there is not other function or
command to do this
example is here..
("ddlSub" & CStr(nRow) & ".DataSourc e = dtrSubject")
I want to evaluate this string to get name of control at runtime e.g.
ddlSub1, ddlSub2, ddlSub3 and so on

How it will be done using Asp.Net 1.1 using Vb.Net ?

TIA

Nov 19 '05 #3

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

Similar topics

37
9703
by: Marek Kotowski | last post by:
I am looking for a tool to execute PHP scripts entered in a HTML form. For example: user is given a problem to solve. He writes a PHP script, sends it to a server, where it is executed and results are send back to the user. Are such tools available at all? Thanks in advance. Marek Kotowski
2
4553
by: michaaal | last post by:
I feel a bit silly asking this because I use this code all the time, but what does the ",,129" mean? Are there other parameters that one might use (I only do fairly simple SQL commands). conn.execute strSQL,,129
1
3093
by: David Laub | last post by:
I have no problems running the following dynamic XPath evaluator form MSXSL: <msxsl:script implements-prefix="dyn" language="jscript"> evaluate(context, expression) { return context.nextNode().selectNodes(expression);
13
33837
by: Zeng | last post by:
Hello, Please help!!! I've been stuck on this issue for months. I just wonder if there is a way to programmatically evaluate expression strings such as ( ( 3 + 5 ) / 2 ) > 4 --> this should return 0 or false( ( 3 + 6 ) / 3 ) > ( ( 5 + 3 ) / 4 ) --> this should return 1 or trueThanks for any comment or
2
2413
by: Rick427 | last post by:
I am new to .NET and was wondering if there is a function like the evaluate function in Cold Fusion that lets you use the value of something as a variable name instead of using a select case statement. For example: Dim Line as String = "Action=Go" Dim URLParts() As String = Line.Split("=") Select Case URLParts(0).ToLower Case "action" us.CapabilityUrls.setAction(URLParts(1)) instead I want to be able to say something like...
6
23965
by: Dan | last post by:
I need to be able to execute a command that is defined in a string. In VBScript, I can do it with the Eval function. How can I do it in VB.Net? I need something like: Dim x As Integer Eval("x = 3") MsgBox x ' Should show a popup with 3 as the message I'm in desperate need of this function. There must be something similar in
3
1520
by: Jerzy Zielinski | last post by:
Hi all, I would like to execute/evaluate a string that contains a VB script, for example: Dim s as string = "Dim avar as integer = 1" ' Evaluate s... so s can be executed during runtime and avar will be created as a result. Thanks.
2
12299
kadghar
by: kadghar | last post by:
Many people asks if there is a way to write a mathematical expression, writen as a string in a text box, so they can do something like: sub something_click() textbox2.text=eval(textbox1.text) end sub Well, of course it's posible, and can be done with some characters mannaging. This way you can complicate it as much as you want. The way i usualy do it is in 5 simple steps: 1. Create 2 string arrays, and save numbers in one and...
1
9443
by: japss | last post by:
I have got a column in my table which stores mathematical formulas as strings. The base question is how do I evaluate the "string formula" to get result? For example, I got a value like '2*5+2*5*4'. I need a way to evaluate this string within an SQL Server stored procedure to get the result as 50 Declare @weight as string Declare @output as numeric(18,2) SET @weight = '2*5+2*5*4'.
0
8486
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8931
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8608
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4418
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2819
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.