Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 18th, 2005, 02:52 PM
Authorized User
 
Join Date: Jun 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to aowen355
Default Variable from ASP,NET to C#

I currently have working C# code that queries a database based on a last name. What I want to do now is pass an inputted variable (such as from a text box) from an ASP.NET webpage to this C# code.
So the user will place the last name in a textbox on the webpage, and once submit is pressed I want to send that last name to the C# code...can anyone help out?


 
Old July 19th, 2005, 01:01 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What do you have so far?

You need a web form with a textbox on it and button to fire off the process.

-Peter
 
Old July 20th, 2005, 09:45 AM
Authorized User
 
Join Date: Jun 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to aowen355
Default

yeh ive got that...what i am trying to figure out is how to i get the ASP.NET page to pass this variable into the C# code and run the C# code as a whole? Is there a certain spot in the aspx.cs file where i can put my code? I know it is kind of hard to understand what I mean, but if i can just figure a way to get ASP.NET to run C# code I would be golden

 
Old July 20th, 2005, 12:25 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

ASP.NET can run C# code, so I'm not sure what you are asking. The codebehind of a C# page can access the controls that you have put on the page. You refer to them by the controlid you provided in the control markup (<asp:textbox runat="server" id="txtLastName" />).

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to share Session variable between ASP.NET ergaurav.nex General .NET 0 December 21st, 2006 02:35 AM
Pass XSL variable back to asp.net page ayamas XSLT 8 September 14th, 2006 06:07 AM
XSLT Parameter to ASP.NET Variable kwilliams XSLT 9 February 9th, 2006 04:27 PM
Session variable Loss - asp.net gala1 VS.NET 2002/2003 1 January 24th, 2005 02:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.