Problems getting values from codebehind page

Hi all, I have an asp.net page which also has a code behind page in C#.

The problem is that I want to access some information from my codebehind page on my ASP.Net page. I've tried putting the information I need in brackets such as
<%textBox1.Text%>

but this reurns the error "CS1002: ; expected"
Any help on the situation is appreciated.
0
shannon_rider
2/9/2005 2:36:09 PM
asp.net.getting-started 91979 articles. 3 followers. Follow

1 Replies
526 Views

Similar Articles

[PageSpeed] 43

Doing this method (called late-binding) is considered "old school" and there now are different ways to do what you're looking for.   For example, if you're trying to assign the text box's text to a lable, in your code behind, just right label.text = textbox1.text

But to answer your question, you will need to store the textbox1.text value into a public variable or function
so in your code behind :
public string TextBoxValue = textbox1.text;
and in your html:
<%=TextBoxValue%>
In this world there are 10 types of people, those that know binary and those who don't.
0
optik
2/9/2005 3:25:25 PM
Reply:

Similar Artilces:

problem with get value from textbox after get it value in load page
hi every one  i have problem with my web site when i get textbox value in load page   and Changed textbox the page do not take last value .   it take value in load page   this is code:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)   TextBox1.Text = "aa" End SubProtected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) MsgBox(TextBox1.Text) End Sub   when i press button message write "aa" while i changed the textbox   please if enyone knowen help me &nbs...

POST GET GET GET GET... WTH?
Hi, I'm at a loss to explain this... I have an ASPX page that I can't always navigate to. When I developed the app (it's Starter Kit Portal-based), I did it on my LAN and have had no trouble accessing the page. However, upon deployment, I see the following behavior: 1. POST request goes out looking for MyForm.aspx 2. GET request for MyForm.aspx 3. GET request for MyForm.aspx 4. ... X. GET request Sometimes, the page finally loads. Other times, it just ends up blank. Many times, it doesn't load at ALL the first POST - I just get a "The pa...

Problem Getting Started
In have run the 1317set.bat file and still get the following error: Unable to get your db version please run version script against your db and restart your web application (go to update/scripts/ folder and run 1317set.bat). Any help to get me started would be much appreciated.www.creativenrg.co.uk | www.therivercard.com Have you checked your connection string? This is sometimes caused by a faulty db connection. I am new to Rainbow and get the same error when trying to run it for the first time. Does not matter which of the following I comment out in web.config: <!-...

Getting things back in Start Page and things out of Start Page
I know I posted over a year ago about this same question, I can not find my original post though. I know I posted it and I did find the solution and posted the sollution but I can not find it anywhere here again. They really need a better search engine on these forums. Is there any tools out there to help manage the start page? For example. I have projects that are on a web server I access them on the remote server. Well the start page never ever shows any updates for it the date posted as last access is the day I created it, However this is one of my more used projects. This one is so b...

Get message that mozilla has to close. Get booted out of web site. Get message from Mozilla to report problem. Problem reporting will not work. Eventually I delete the report message.
Name: Linnea Hagberg Email: lhagbergatsmithcovedotcom Product: Mozilla Suite Summary: Get message that mozilla has to close. Get booted out of web site. Get message from Mozilla to report problem. Problem reporting will not work. Eventually I delete the report message. Comments: See above. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 ...

Page is not getting refreshed but my datagrid is getting refreshed how to refresh the page
Hi EveryOne, Im getting a problem here that my datgrid is getting refreshed for every Updation ,Edit,Cancel commands but the page is not getting refreshed so anybody can help me how a page gets refreshed in a button click in C# of Asp.Net.                            Thanx in Advance RuttsRatnakar Choudry,c.ratnakar@gmail.com,Tension Nahi Leneka Apun Hai Nah... When you do an update on the DataGrid, for sure a postback happens! So how is it that the DataG...

How to get a value from <select> group inASP.NET Page?
Hi all! I don't have a clue how I can get a value from some <select> group on my page? From where I can find all the components on my page and on my form? Thankyou in advance!!Arto Kainu BScEng Joensuu, Finland Do you mean an HTML select which can be either a listbox or a dropdown. You can use the asp.net server control called dropdownlist, you can access its selected value using MyDropDownList.SelectedItem to get the selected text or MyDropDownList.SelectedValue to get the selected value. Simon...

Problem in getting Oracle function return value using ODP.net
 Dear AllI fall a problem by getting value from oracle function in asp.net. the code is as follows...the oracle function is ...start... create or replace function ultimus.FXN_GET_TRAN_DATE(pBRANCH_ID IN VARCHAR2) return date is-- ********************************************************************************-- Description: Get Branch Working Date-- ================================================================================  Result DATE;begin     Select  DECODE(a.day_status_id, 2, a.TRAN_DT, NULL) AS TRAN_DT      Into Resu...

getting textbox value from one page to other page....
Hello Frinds I have a question..  I am entering one userid in the textbox I am getting info from dtabase I am displying.. this userid I am using in other aspx page so i need to use this textbox userid in that page can you tell me any one how i need to get that value from one page to other page.. ASAP thanks.. I believe you can take advantage of QueryString when Passing data from one page to another.   When you redirect to the other page, you can passthe USERID as string to the Url and get that information from there Thanks for your replay Can you give me sample code sir...

How can i create get values from Opened page in client side to my first page(server page)
i have a little bit problem that my Server page has coding like this : btn.attributes.add("onclick()",getdata()) and one text box is txt1 now when user clicks it Button btn then getdata function  executes ok client page function getdata(){ response.redirect("hello.aspx") } now on hello.aspx has 1 textbox txt2   now what ever the data has been inputted by user in (client side textbox) txt2 i want to assign it to txt1 (server side )conrtol on server pls help me send me code ...  Jay "Enjoy Life" When you do the redirect from Page #2 back to Page...

Query for substring to get some particular value in a string (Get querystring value by sql )
I have a column name URL in Table1 with data like  <a href="/Folder1/view_media_news.cfm?news_media_i=1">August 2002 Factsheet</a>            <a href="/Folder1/view_media_news.cfm?news_media_i=149">March 2002 Newsletter </a>  i need to grab the news_media_i value by sql query  Please any one can help me to get that particular value from string using substring or any other suggestion Thank you in advance SurendraIf this helps mark it as answer surendra_kla:i nee...

trying to get started and i am getting this error
when i go to http://www.porkchopsplayground.com, i get: DotNetNuke Upgrade Error The Assembly Version ( [ASSEMBLYVERSION] ) does not match the Database Version ( [DATABASEVERSION] ) ERROR: Could not connect to database. Could not find file 'd:\hosting\nmoran26\Providers\DataProviders\AccessDataProvider\DotNetNuke.mdb'. Any suggestions will be appreciated. Thanks, Nicole Do you have a username and password set on your database? Make sure you follow the steps mentionned in the Readme.txt located in the documentation folder. In any case make sure your credentials for yo...

Do not get expected WEb page on secondary
netware 6.5 sp2 Have setup a web page on a seconary IP address Load appache with the following command line LOAD ADDRESS SPACE = CSMI APACHE2 -f SYS:APACHE2\CSMI\SERVER\HTTPD.CONF Where HTTPD.CONF is set up to Listen 172.16.212.2:80 which is a secondary ip address A display secondary ipaddress at the server lists the seconary ipaddress I can ping the secondary ip address from the client in Remote manager using IP Address management the secondary IP addresses are not listed When I attempt to brose to the HTTP://172.16.212.2 address I do not see the web page I...

How to get the HREF value of the Anchor tag in a web page using the web browser control in vb.net
Hi Friends,               i have a webserver control in my application.i load the web browser control on a button click using the below code Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click                AxWebBrowser1.Navigate("http://www.rateitall.com/i-322335-.aspx", False) End sub once the page is loaded in the browser i want the <a> HREF value in that page.For example if that page has ...

Web resources about - Problems getting values from codebehind page - asp.net.getting-started

ASP.NET - Wikipedia, the free encyclopedia
ASP.NET is a server-side Web application framework designed for Web development to produce dynamic Web pages . It was developed by Microsoft ...

C# dotnet SQL Editor (webform side)
Every time I need to develop a small business application I always try to choose the fastest and simplest way to implement it. This is why I ...

xClassNotDerivedFromElement – Another Non-Informative XAML Parse Error
... XAML is due to my lazyness. I Created a new xaml file but used the view template rather than a Resource Dictionary one, yes I deleted the codebehind ...

WPF Onyx
WPF Model-View-ViewModel framework.

Stronger Backbone - Part 2
... development, there was a framework called WebForms that developers would use to create web applications. WebForms used a system called "CodeBehind" ...

Use Custom Http Handlers To Improve Performance in ASP.NET
While reading a chapter from the upcoming book from Addison-Wesley entitled Essential ASP.NET with Examples in C# , I ran across a chapter on ...

Developing a Windows Phone Application using the MVVM Pattern
This documentation includes a companion sample application named PetrolTracker. PetrolTracker is an application written in Silverlight for Windows ...

Struggling for Competence
An event lets a publisher notify subscribers when something happens. The article examines event rules and convention, and presents a c# example. ...

CodeSOD: The Apex of T-SQL
... has all sorts of different ways to generate HTML. Rarely, it’s WebForms code living in as ASPX. Far more often, it’s hard-coded into the CodeBehind. ...

Happy Birthday, APRSdroid (my OSS Scala app for Android)!
APRSdroid is an Amateur Radio geo-location( APRS ) app for Android licensed under the GPL.It started as a Scala learning experience twoyears ...

Resources last updated: 12/4/2015 5:39:56 AM