CommandArgument for a texbox control inside a repeater

Can  I do a commandargument on a textbox like this?
 <asp:TextBox ID="TextBox1" runat="server" class="css_input_type" value="0" maxlength="15"onkeypress="return disableEnterKey(event)" commandargument='<%#Eval("ACCOUNT") %>'></asp:TextBox>

Open in new window

zachvaldezAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kyle AbrahamsSenior .Net DeveloperCommented:
Not sure if commandArgument works but I found using the Tag field works in general.

Also note that you can access the entire textbox via:
protected void rpt_ItemCommand(object sender, RepeaterCommandEventArgs e)
{
TextBox tb1 = (TextBox)e.Item.FindControl("Textbox1");
//you can now access, tb1.Text, tb1.Tag, etc.
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zachvaldezAuthor Commented:
Can I do an Insert Stored procedure in this event?
0
Kyle AbrahamsSenior .Net DeveloperCommented:
yep.  Just create your command or pass it to your context depending on what you're doing.
0
zachvaldezAuthor Commented:
just like in your code
protected void rpt_ItemCommand(object sender, RepeaterCommandEventArgs e)
{
TextBox tb1 = (TextBox)e.Item.FindControl("Textbox1");
//you can now access, tb1.Text, tb1.Tag, etc.

//Insert an insert stored procedure routine here...
}

Open in new window

0
zachvaldezAuthor Commented:
Thanks!
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.