views:

34

answers:

1

I have a Telerik:RadTextBox control in my markup called txtName. I'm trying to retrieve the inputed value in the code behind with foo = txtName.Text; but var and txtName always show an empty string.

Any ideas?

Markup

<telerik:RadTextBox ID="txtName" Runat="server" Width="300px" />

CodeBehind

campaign.Name = txtName.Text.Trim();

I guess the code couldn't be easier. Basically what's happening is, when I click my 'save' button, there's a postback and the text in the RadTextBox just disappears.

update
Found the problem. My web.config file had a different version of the Telerik dll file that was actually in my bin folder.

A: 

You're not actually using "var" as a variable name, right? It's a reserved word in C# 4.

Matthew Graybosch
I'm using it here as an example.
CSharper
I'd suggest using "foo" instead, but that's what I get for having C on a Sun machine as my first programming experience. Is there any chance you can post some code from your code-behind so we can see what you're actually doing?
Matthew Graybosch