473,320 Members | 2,098 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,320 software developers and data experts.

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) & ".DataSource = 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 2756
You can do a Page.FindControl("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:placeholder id="plc" runat="server">
<asp:dropdownlist id="ddl" runat="server">
</asp:placeholder>

rather, you'll need to eitehr nest them:
Page.FindControl("plc").FindControl("ddl")

or base it off the parent control:
ddlontrol.FindControl("ddl")
of course, if the control isn't nested, you can just do
Page.FindControl("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********@yahoo.com> wrote in message
news:ex**************@TK2MSFTNGP09.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) & ".DataSource = 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********@yahoo.com> wrote in message
news:ex**************@TK2MSFTNGP09.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) & ".DataSource = 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
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...
2
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). ...
1
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...
13
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...
2
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...
6
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...
3
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...
2
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)...
1
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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: 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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.